Skip to content

Commit 82f62ef

Browse files
author
jantje
committed
make Teensytest successfull if teensy is not installed
This to avoid problems with failing tests
1 parent aaaf3a3 commit 82f62ef

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,18 @@ public CreateAndCompileArduinoIDEExamplesOnTeensyTest(String name, CodeDescripto
5252
@SuppressWarnings("rawtypes")
5353
@Parameters(name = "{index}: {0}")
5454
public static Collection examples() {
55-
BoardsManager.referenceLocallInstallation(Shared.getTeensyPlatform());
55+
LinkedList<Object[]> examples = new LinkedList<>();
56+
if(Shared.getTeensyPlatform().isEmpty()) {
57+
System.err.println("ERROR: Teensy not installed/configured skipping tests!!!");
58+
}
59+
else {
60+
BoardsManager.referenceLocallInstallation(Shared.getTeensyPlatform());
61+
}
62+
5663

5764
Shared.waitForAllJobsToFinish();
5865

59-
LinkedList<Object[]> examples = new LinkedList<>();
66+
6067
TreeMap<String, IPath> exampleFolders = BoardsManager.getAllArduinoIDEExamples();
6168
for (Map.Entry<String, IPath> curexample : exampleFolders.entrySet()) {
6269
ArrayList<Path> paths = new ArrayList<>();
@@ -105,37 +112,44 @@ public void testExample(IBoard board) {
105112

106113
@Test
107114
public void testArduinoIDEExamplesOnTeensy3_6() {
115+
if (!Shared.getTeensyPlatform().isEmpty())
108116
testExample(new GenericTeensyBoard("teensy36"));
109117
}
110118

111119
@Test
112120
public void testArduinoIDEExamplesOnTeensy3_5() {
121+
if (!Shared.getTeensyPlatform().isEmpty())
113122
testExample(new GenericTeensyBoard("teensy35"));
114123
}
115124

116125
@Test
117126
public void testArduinoIDEExamplesOnTeensy3_1() {
127+
if (!Shared.getTeensyPlatform().isEmpty())
118128
testExample(new GenericTeensyBoard("teensy31"));
119129
}
120130

121131
@Test
122132
public void testArduinoIDEExamplesOnTeensy3_0() {
133+
if (!Shared.getTeensyPlatform().isEmpty())
123134
testExample(new GenericTeensyBoard("teensy30"));
124135
}
125136

126137
@Test
127138
public void testArduinoIDEExamplesOnTeensyLC() {
139+
if (!Shared.getTeensyPlatform().isEmpty())
128140
testExample(new GenericTeensyBoard("teensyLC"));
129141
}
130142

131143
@Test
132144
public void testArduinoIDEExamplesOnTeensyPP2() {
145+
if (!Shared.getTeensyPlatform().isEmpty())
133146
testExample(new GenericTeensyBoard("teensypp2"));
134147
}
135148

136149
@Test
137150
public void testArduinoIDEExamplesOnTeensy2() {
138-
testExample(new GenericTeensyBoard("teensy2"));
151+
if (!Shared.getTeensyPlatform().isEmpty())
152+
testExample(new GenericTeensyBoard("teensy2"));
139153

140154
}
141155

0 commit comments

Comments
 (0)