1- # AUnit - Unit Testing Framework for Arduino Platforms
1+ # AUnit
2+
3+ A unit testing framework for Arduino platforms inspired by ArduinoUnit and
4+ Google Test.
25
36Version: 0.4.0 (2018-03-30)
47
@@ -87,6 +90,8 @@ Here are the features in AUnit which are not available in ArduinoUnit:
8790 * ` externTestF() `
8891 * ` externTestingF() `
8992* AUnit works on the ESP8266 platform.
93+ * Test filters (` TestRunner::include() ` and ` TestRunner::exclude() ` ) support the
94+ same 2 arguments versions corresponding to ` testF() ` and ` testingF() `
9095
9196### Beta Status
9297
@@ -130,6 +135,7 @@ The `examples/` directory has a number of examples:
130135In the ` tests/ ` directory:
131136
132137* ` AUnitTest ` - the unit test for ` AUnit ` itself has a large number of examples
138+ * ` FilterTest ` - manual tests for ` include() ` and ` exclude() ` filters
133139
134140### Header and Namespace
135141
@@ -237,7 +243,7 @@ class CustomTestAgain: public TestAgain {
237243 }
238244};
239245
240- testingF(CustomTestAgain, examle_test ) {
246+ testingF(CustomTestAgain, example_test ) {
241247 ...
242248 assertBigStuff();
243249 ...
@@ -249,6 +255,7 @@ void setup() {
249255
250256 TestRunner::exclude("*");
251257 TestRunner::include("looping*");
258+ TestRunner::include("CustomTestAgain", "example*");
252259}
253260
254261void loop() {
@@ -628,36 +635,45 @@ ArduinoUnit, each call to `Test::run()` will process the entire list of
628635currently active test cases. In AUnit, each call to ` TestRunner::run() ` performs
629636only a single test case, then returns._
630637
631- ### Excluding and Including Test Cases
638+ ### Filtering Test Cases
632639
633- We can ` exclude() ` or ` include() ` test cases using a pattern match,
634- just like ArduinoUnit. The names are slightly different:
640+ We can ` exclude() ` or ` include() ` test cases using a pattern match:
641+
642+ * ` TestRunner::exclude(pattern) `
643+ * ` TestRunner::exclude(testClass, pattern) `
644+ * ` TestRunner::include(pattern) `
645+ * ` TestRunner::include(testClass, pattern) `
635646
636- * ` TestRunner::exclude() `
637- * ` TestRunner::include() `
638647
639648These methods are called from the global ` setup() ` method:
640649
641650```
642651void setup() {
643652 TestRunner::exclude("*");
644653 TestRunner::include("looping*");
654+ TestRunner::exclude("CustomTestAgain", "*");
655+ TestRunner::include("CustomTestAgain", "test*");
645656 ...
646657}
647658```
648659
660+ The 2-argument versions of ` include() ` and ` exclude() ` correspond to the
661+ 2 arguments of ` testF() ` and ` testingF() ` .
662+
649663*** ArduinoUnit Compatibility*** :
650664_ The equivalent versions in ArduinoUnit are ` Test::exclude() ` and
651- ` Test::include() ` The matching algorithm in AUnit is not as powerful as one in
652- ArduinoUnit. AUnit supports only a single wildcard character ` * ` and that
665+ ` Test::include() ` The matching algorithm in AUnit is not as powerful as the one
666+ in ArduinoUnit. AUnit supports only a single wildcard character ` * ` and that
653667character can appear only at the end if it is present. For example, the
654668following are accepted:_
655669
656670* ` TestRunner::exclude("*"); `
657671* ` TestRunner::include("f*"); `
658672* ` TestRunner::exclude("flash_*"); `
659673* ` TestRunner::include("looping*"); `
660- * ` TestRunner::include("flashTest"); `
674+ * ` TestRunner::include("CustomTestOnce", "flashTest*"); `
675+
676+ _ AUnit provides 2-argument versions of ` include() ` and ` exclude() ` _
661677
662678### Output Printer
663679
0 commit comments