Skip to content

Commit d173d59

Browse files
author
jan
committed
Rerun arduino avr tests
Basically update to changes that made the tests not applicable/correct The fqn ogf exxamples had changed The examples included all examples (also the ones of the libraries) making way to many tests fail
1 parent 6893525 commit d173d59

File tree

2 files changed

+102
-101
lines changed

2 files changed

+102
-101
lines changed

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.stream.Stream;
2323

2424
import org.eclipse.core.runtime.IPath;
25+
import org.junit.jupiter.api.BeforeAll;
2526
import org.junit.jupiter.params.ParameterizedTest;
2627
import org.junit.jupiter.params.provider.Arguments;
2728
import org.junit.jupiter.params.provider.MethodSource;
@@ -39,20 +40,20 @@ public class CreateAndCompileArduinoIDEExamplesOnAVRHardwareTest {
3940
private static int maxFails = 50;
4041
private static int mySkipAtStart = 0;
4142

42-
43-
public static Stream<Arguments> avrHardwareData() throws Exception {
43+
@BeforeAll
44+
public static void setup() throws Exception {
45+
Shared.waitForBoardsManager();
46+
Shared.setUseParralBuildProjects(Boolean.TRUE);
4447
Shared.waitForAllJobsToFinish();
4548
Preferences.setUseBonjour(false);
49+
}
4650

4751

48-
// Example testExample = new Example("Firmata:AllInputsFirmata", new Path("C:/Users/jan/Documents/Arduino/libraries/Firmata/examples/AllInputsFirmata"));
49-
// MCUBoard robotControler= Arduino.robotControl();
50-
// boolean ret=testExample.worksOnBoard(robotControler);
51-
52+
public static Stream<Arguments> avrHardwareData() throws Exception {
5253

5354
List<Arguments> ret = new LinkedList<>();
5455
List<MCUBoard> allBoards = Arduino.getAllAvrBoards();
55-
TreeMap<String, IExample> exampleFolders = LibraryManager.getExamplesLibrary(null);
56+
TreeMap<String, IExample> exampleFolders = LibraryManager.getExamplesFromIDE();
5657
for (Map.Entry<String, IExample> curexample : exampleFolders.entrySet()) {
5758
String fqn = curexample.getKey().trim();
5859
IPath examplePath = curexample.getValue().getCodeLocation();
@@ -95,11 +96,11 @@ public void testExample(String projectName, CodeDescription codeDescriptor,
9596

9697
assumeTrue( Shared.buildCounter++ >= mySkipAtStart,"Skipping first " + mySkipAtStart + " tests");
9798
assumeTrue( myTotalFails < maxFails,"To many fails. Stopping test");
98-
99+
Shared.getLastFailMessage();
99100
myTotalFails++;
100101
assertNull (Shared.buildAndVerify(projectName, board.getBoardDescriptor(), codeDescriptor,
101102
new CompileDescription())) ;
102-
myTotalFails++;
103+
myTotalFails--;
103104
}
104105

105106
}

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

+92-92
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public Example(String fqn, IPath path) throws Exception {
6363

6464
private static int getNumADCUsedInExample(String myFQN2) {
6565
switch (myFQN2) {
66-
case "Example/04.Communication/VirtualColorMixer":
67-
case "Example/10.StarterKit_BasicKit/p04_ColorMixingLamp":
66+
case "Examples/04.Communication/VirtualColorMixer":
67+
case "Examples/10.StarterKit_BasicKit/p04_ColorMixingLamp":
6868
return 3;
69-
case "Example/06.Sensors/ADXL3xx":
69+
case "Examples/06.Sensors/ADXL3xx":
7070
return 4;
71-
case "Example/08.Strings/StringComparisonOperators":
71+
case "Examples/08.Strings/StringComparisonOperators":
7272
return 6;
7373
default:
7474
return 0;
@@ -98,102 +98,102 @@ private static LinkedList<String> examplesUsingMidi() {
9898

9999
private static LinkedList<String> examplesUsingFlightSim() {
100100
LinkedList<String> ret = new LinkedList<>();
101-
ret.add("Example/Teensy/USB_FlightSim/BlinkTransponder");
102-
ret.add("Example/Teensy/USB_FlightSim/FrameRateDisplay");
103-
ret.add("Example/Teensy/USB_FlightSim/NavFrequency");
104-
ret.add("Example/Teensy/USB_FlightSim/ThrottleServo");
101+
ret.add("Examples/Teensy/USB_FlightSim/BlinkTransponder");
102+
ret.add("Examples/Teensy/USB_FlightSim/FrameRateDisplay");
103+
ret.add("Examples/Teensy/USB_FlightSim/NavFrequency");
104+
ret.add("Examples/Teensy/USB_FlightSim/ThrottleServo");
105105
return ret;
106106
}
107107

108108
private static LinkedList<String> examplesUsingSerial1() {
109109
LinkedList<String> ret = new LinkedList<>();
110-
ret.add("Example/04.Communication/MultiSerial");
111-
ret.add("Example/04.Communication/SerialPassthrough");
112-
ret.add("Example/Teensy/Serial/EchoBoth");
110+
ret.add("Examples/04.Communication/MultiSerial");
111+
ret.add("Examples/04.Communication/SerialPassthrough");
112+
ret.add("Examples/Teensy/Serial/EchoBoth");
113113
return ret;
114114
}
115115

116116
private static LinkedList<String> examplesUsingSerialUSB() {
117117
LinkedList<String> ret = new LinkedList<>();
118-
ret.add("Example/11.ArduinoISP/ArduinoISP");
118+
ret.add("Examples/11.ArduinoISP/ArduinoISP");
119119
return ret;
120120
}
121121

122122
private static LinkedList<String> examplesUsingDirectMode() {
123123
LinkedList<String> ret = new LinkedList<>();
124-
ret.add("Example/10.StarterKit_BasicKit/p13_TouchSensorLamp");
124+
ret.add("Examples/10.StarterKit_BasicKit/p13_TouchSensorLamp");
125125
return ret;
126126
}
127127

128128
private static LinkedList<String> examplesUsingKeyboard() {
129129
LinkedList<String> ret = new LinkedList<>();
130-
ret.add("Example/09.USB/Keyboard/KeyboardLogout");
131-
ret.add("Example/09.USB/Keyboard/KeyboardMessage");
132-
ret.add("Example/09.USB/Keyboard/KeyboardReprogram");
133-
ret.add("Example/09.USB/Keyboard/KeyboardSerial");
134-
ret.add("Example/09.USB/Mouse/ButtonMouseControl");
135-
ret.add("Example/09.USB/Mouse/JoystickMouseControl");
136-
ret.add("Example/09.USB/KeyboardAndMouseControl");
130+
ret.add("Examples/09.USB/Keyboard/KeyboardLogout");
131+
ret.add("Examples/09.USB/Keyboard/KeyboardMessage");
132+
ret.add("Examples/09.USB/Keyboard/KeyboardReprogram");
133+
ret.add("Examples/09.USB/Keyboard/KeyboardSerial");
134+
ret.add("Examples/09.USB/Mouse/ButtonMouseControl");
135+
ret.add("Examples/09.USB/Mouse/JoystickMouseControl");
136+
ret.add("Examples/09.USB/KeyboardAndMouseControl");
137137
return ret;
138138
}
139139

140140
private static LinkedList<String> examplesUsingSerial() {
141141
LinkedList<String> ret = new LinkedList<>();
142-
ret.add("Example/01.Basics/AnalogReadSerial");
143-
ret.add("Example/01.Basics/DigitalReadSerial");
144-
ret.add("Example/01.Basics/ReadAnalogVoltage");
145-
ret.add("Example/02.Digital/DigitalInputPullup");
146-
ret.add("Example/02.Digital/StateChangeDetection");
147-
ret.add("Example/02.Digital/tonePitchFollower");
148-
ret.add("Example/03.Analog/AnalogInOutSerial");
149-
ret.add("Example/03.Analog/Smoothing");
150-
ret.add("Example/04.Communication/ASCIITable");
151-
ret.add("Example/04.Communication/Dimmer");
152-
ret.add("Example/04.Communication/Graph");
153-
ret.add("Example/04.Communication/Midi");
154-
ret.add("Example/04.Communication/PhysicalPixel");
155-
ret.add("Example/04.Communication/ReadASCIIString");
156-
ret.add("Example/04.Communication/SerialCallResponse");
157-
ret.add("Example/04.Communication/SerialCallResponseASCII");
158-
ret.add("Example/04.Communication/SerialEvent");
159-
ret.add("Example/04.Communication/VirtualColorMixer");
160-
ret.add("Example/05.Control/IfStatementConditional");
161-
ret.add("Example/05.Control/switchCase");
162-
ret.add("Example/05.Control/switchCase2");
163-
ret.add("Example/06.Sensors/ADXL3xx");
164-
ret.add("Example/06.Sensors/Knock");
165-
ret.add("Example/06.Sensors/Memsic2125");
166-
ret.add("Example/06.Sensors/Ping");
167-
ret.add("Example/08.Strings/CharacterAnalysis");
168-
ret.add("Example/08.Strings/StringAdditionOperator");
169-
ret.add("Example/08.Strings/StringAppendOperator");
170-
ret.add("Example/08.Strings/StringCaseChanges");
171-
ret.add("Example/08.Strings/StringCharacters");
172-
ret.add("Example/08.Strings/StringComparisonOperators");
173-
ret.add("Example/08.Strings/StringConstructors");
174-
ret.add("Example/08.Strings/StringIndexOf");
175-
ret.add("Example/08.Strings/StringLength");
176-
ret.add("Example/08.Strings/StringLengthTrim");
177-
ret.add("Example/08.Strings/StringReplace");
178-
ret.add("Example/08.Strings/StringStartsWithEndsWith");
179-
ret.add("Example/08.Strings/StringSubstring");
180-
ret.add("Example/08.Strings/StringToInt");
181-
ret.add("Example/10.StarterKit_BasicKit/p03_LoveOMeter");
182-
ret.add("Example/10.StarterKit_BasicKit/p04_ColorMixingLamp");
183-
ret.add("Example/10.StarterKit_BasicKit/p05_ServoMoodIndicator");
184-
ret.add("Example/10.StarterKit_BasicKit/p07_Keyboard");
185-
ret.add("Example/10.StarterKit_BasicKit/p12_KnockLock");
186-
ret.add("Example/10.StarterKit_BasicKit/p13_TouchSensorLamp");
187-
ret.add("Example/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo");
188-
ret.add("Example/11.ArduinoISP/ArduinoISP");
189-
ret.add("Example/Teensy/Tutorial3/HelloSerialMonitor");
190-
ret.add("Example/Teensy/Tutorial3/Pushbutton");
191-
ret.add("Example/Teensy/Tutorial3/PushbuttonPullup");
192-
ret.add("Example/Teensy/Tutorial3/PushbuttonRGBcolor");
193-
ret.add("Example/Teensy/Tutorial4/AnalogInput");
194-
ret.add("Example/Teensy/Tutorial4/TemperatureNumberOnly");
195-
ret.add("Example/Teensy/Tutorial4/TemperatureScaled");
196-
ret.add("Example/Teensy/Tutorial4/TemperatureScaledMulti");
142+
ret.add("Examples/01.Basics/AnalogReadSerial");
143+
ret.add("Examples/01.Basics/DigitalReadSerial");
144+
ret.add("Examples/01.Basics/ReadAnalogVoltage");
145+
ret.add("Examples/02.Digital/DigitalInputPullup");
146+
ret.add("Examples/02.Digital/StateChangeDetection");
147+
ret.add("Examples/02.Digital/tonePitchFollower");
148+
ret.add("Examples/03.Analog/AnalogInOutSerial");
149+
ret.add("Examples/03.Analog/Smoothing");
150+
ret.add("Examples/04.Communication/ASCIITable");
151+
ret.add("Examples/04.Communication/Dimmer");
152+
ret.add("Examples/04.Communication/Graph");
153+
ret.add("Examples/04.Communication/Midi");
154+
ret.add("Examples/04.Communication/PhysicalPixel");
155+
ret.add("Examples/04.Communication/ReadASCIIString");
156+
ret.add("Examples/04.Communication/SerialCallResponse");
157+
ret.add("Examples/04.Communication/SerialCallResponseASCII");
158+
ret.add("Examples/04.Communication/SerialEvent");
159+
ret.add("Examples/04.Communication/VirtualColorMixer");
160+
ret.add("Examples/05.Control/IfStatementConditional");
161+
ret.add("Examples/05.Control/switchCase");
162+
ret.add("Examples/05.Control/switchCase2");
163+
ret.add("Examples/06.Sensors/ADXL3xx");
164+
ret.add("Examples/06.Sensors/Knock");
165+
ret.add("Examples/06.Sensors/Memsic2125");
166+
ret.add("Examples/06.Sensors/Ping");
167+
ret.add("Examples/08.Strings/CharacterAnalysis");
168+
ret.add("Examples/08.Strings/StringAdditionOperator");
169+
ret.add("Examples/08.Strings/StringAppendOperator");
170+
ret.add("Examples/08.Strings/StringCaseChanges");
171+
ret.add("Examples/08.Strings/StringCharacters");
172+
ret.add("Examples/08.Strings/StringComparisonOperators");
173+
ret.add("Examples/08.Strings/StringConstructors");
174+
ret.add("Examples/08.Strings/StringIndexOf");
175+
ret.add("Examples/08.Strings/StringLength");
176+
ret.add("Examples/08.Strings/StringLengthTrim");
177+
ret.add("Examples/08.Strings/StringReplace");
178+
ret.add("Examples/08.Strings/StringStartsWithEndsWith");
179+
ret.add("Examples/08.Strings/StringSubstring");
180+
ret.add("Examples/08.Strings/StringToInt");
181+
ret.add("Examples/10.StarterKit_BasicKit/p03_LoveOMeter");
182+
ret.add("Examples/10.StarterKit_BasicKit/p04_ColorMixingLamp");
183+
ret.add("Examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator");
184+
ret.add("Examples/10.StarterKit_BasicKit/p07_Keyboard");
185+
ret.add("Examples/10.StarterKit_BasicKit/p12_KnockLock");
186+
ret.add("Examples/10.StarterKit_BasicKit/p13_TouchSensorLamp");
187+
ret.add("Examples/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo");
188+
ret.add("Examples/11.ArduinoISP/ArduinoISP");
189+
ret.add("Examples/Teensy/Tutorial3/HelloSerialMonitor");
190+
ret.add("Examples/Teensy/Tutorial3/Pushbutton");
191+
ret.add("Examples/Teensy/Tutorial3/PushbuttonPullup");
192+
ret.add("Examples/Teensy/Tutorial3/PushbuttonRGBcolor");
193+
ret.add("Examples/Teensy/Tutorial4/AnalogInput");
194+
ret.add("Examples/Teensy/Tutorial4/TemperatureNumberOnly");
195+
ret.add("Examples/Teensy/Tutorial4/TemperatureScaled");
196+
ret.add("Examples/Teensy/Tutorial4/TemperatureScaledMulti");
197197

198198

199199
ret.add("Library/Managed/LiquidCrystal/SerialDisplay");
@@ -202,38 +202,38 @@ private static LinkedList<String> examplesUsingSerial() {
202202

203203
private static LinkedList<String> examplesUsingJoyStick() {
204204
LinkedList<String> ret = new LinkedList<>();
205-
ret.add("Example/Teensy/USB_Joystick/Basic");
206-
ret.add("Example/Teensy/USB_Joystick/Buttons");
207-
ret.add("Example/Teensy/USB_Joystick/Complete");
205+
ret.add("Examples/Teensy/USB_Joystick/Basic");
206+
ret.add("Examples/Teensy/USB_Joystick/Buttons");
207+
ret.add("Examples/Teensy/USB_Joystick/Complete");
208208
return ret;
209209
}
210210

211211
private static LinkedList<String> examplesUsingMouse() {
212212
LinkedList<String> ret = new LinkedList<>();
213-
ret.add("Example/Teensy/USB_Joystick/Basic");
214-
ret.add("Example/Teensy/USB_Joystick/Buttons");
215-
ret.add("Example/Teensy/USB_Joystick/Complete");
216-
ret.add("Example/Teensy/USB_RawHID/Basic");
213+
ret.add("Examples/Teensy/USB_Joystick/Basic");
214+
ret.add("Examples/Teensy/USB_Joystick/Buttons");
215+
ret.add("Examples/Teensy/USB_Joystick/Complete");
216+
ret.add("Examples/Teensy/USB_RawHID/Basic");
217217
return ret;
218218
}
219219

220220
private static LinkedList<String> examplesUsingTone() {
221221
LinkedList<String> ret = new LinkedList<>();
222-
ret.add("Example/10.StarterKit_BasicKit/p06_LightTheremin");
223-
ret.add("Example/02.Digital/toneMultiple");
224-
ret.add("Example/02.Digital/toneMelody");
225-
ret.add("Example/02.Digital/toneKeyboard");
226-
ret.add("Example/02.Digital/tonePitchFollower");
227-
ret.add("Example/10.StarterKit_BasicKit/p07_Keyboard");
222+
ret.add("Examples/10.StarterKit_BasicKit/p06_LightTheremin");
223+
ret.add("Examples/02.Digital/toneMultiple");
224+
ret.add("Examples/02.Digital/toneMelody");
225+
ret.add("Examples/02.Digital/toneKeyboard");
226+
ret.add("Examples/02.Digital/tonePitchFollower");
227+
ret.add("Examples/10.StarterKit_BasicKit/p07_Keyboard");
228228
return ret;
229229
}
230230

231231
private static LinkedList<String> examplesUsingWire1() {
232232
LinkedList<String> ret = new LinkedList<>();
233-
ret.add("Example/Teensy/USB_Joystick/Basic");
234-
ret.add("Example/Teensy/USB_Joystick/Buttons");
235-
ret.add("Example/Teensy/USB_Joystick/Complete");
236-
ret.add("Example/Teensy/USB_RawHID/Basic");
233+
ret.add("Examples/Teensy/USB_Joystick/Basic");
234+
ret.add("Examples/Teensy/USB_Joystick/Buttons");
235+
ret.add("Examples/Teensy/USB_Joystick/Complete");
236+
ret.add("Examples/Teensy/USB_RawHID/Basic");
237237
ret.add("Library/Managed/Adafruit_BME280_Library/advancedsettings");
238238
ret.add("Library/Managed/AS3935MI/AS3935MI_LightningDetector_otherInterfaces");
239239
return ret;

0 commit comments

Comments
 (0)