|
3 | 3 | A unit testing framework for Arduino platforms inspired by ArduinoUnit and |
4 | 4 | Google Test. |
5 | 5 |
|
6 | | -Version: 0.5.1 (2018-05-01) |
| 6 | +Version: 0.5.2 (2018-05-08) |
7 | 7 |
|
8 | 8 | ## Summary |
9 | 9 |
|
@@ -87,10 +87,10 @@ Here are the features in AUnit which are not available in ArduinoUnit: |
87 | 87 | * `externTestF()` |
88 | 88 | * `externTestingF()` |
89 | 89 | * Status setters |
90 | | - * `passNow()` |
91 | | - * `failNow()` |
92 | | - * `skipNow()` |
93 | | - * `expireNow()` |
| 90 | + * `passTestNow()` |
| 91 | + * `failTestNow()` |
| 92 | + * `skipTestNow()` |
| 93 | + * `expireTestNow()` |
94 | 94 | * `teardown()` method, mirroring the `setup()` |
95 | 95 | * `teardown()` |
96 | 96 | * Tested on the following Arduino platforms: |
@@ -251,9 +251,9 @@ testing(looping_test) { |
251 | 251 | if (...) { |
252 | 252 | pass(); |
253 | 253 | } else if (...) { |
254 | | - failNow(); |
| 254 | + failTestNow(); |
255 | 255 | } else { |
256 | | - skipNow(); |
| 256 | + skipTestNow(); |
257 | 257 | } |
258 | 258 | } |
259 | 259 |
|
@@ -664,41 +664,43 @@ AUnitTest.ino, line 439. |
664 | 664 | _AUnit has a separate message handler to print a customized message for the |
665 | 665 | assertTestXxx() meta assertion macros._ |
666 | 666 |
|
667 | | -### Status Indicator Methods |
| 667 | +### Unconditional Termination |
668 | 668 |
|
669 | 669 | The following macros can be used inside the body of `test()` or `testing()` |
670 | | -macro to indicate whether the test has passed or failed (or reached some other |
671 | | -status). Each macro prints a short message, and returns immediately from the |
672 | | -test, much like an `assertXxx()` macro that fails. |
| 670 | +macro to terminate a test unconditionally. Each macro prints a short message, |
| 671 | +and returns immediately from the test, much like an `assertXxx()` macro that |
| 672 | +fails. |
673 | 673 |
|
674 | | -* `passNow()` [*] |
675 | | -* `failNow()` [*] |
676 | | -* `skipNow()` [*] |
677 | | -* `expireNow()` [*] |
| 674 | +* `passTestNow()` [*] |
| 675 | +* `failTestNow()` [*] |
| 676 | +* `skipTestNow()` [*] |
| 677 | +* `expireTestNow()` [*] |
678 | 678 |
|
679 | | -The message looks like: |
| 679 | +The messages look like: |
680 | 680 | ``` |
681 | | -Status timed out, file AUnitTest.ino, line 381. |
682 | | -Status failed, file AUnitTest.ino, line 378. |
| 681 | +Status passed, file AUnitTest.ino, line 360. |
683 | 682 | Status failed, file AUnitTest.ino, line 378. |
684 | 683 | Status skipped, file AUnitTest.ino, line 380. |
| 684 | +Status timed out, file AUnitTest.ino, line 391. |
685 | 685 | ``` |
686 | 686 |
|
687 | | -The above methods are recommended over the following methods on the `Test` class |
688 | | -because the `xxxNow()` versions print the file and line number of the statement. |
689 | | -The methods on `Test` are completely silent which makes debugging difficult. |
| 687 | +The following methods on the `Test` class also set the `status` of the test, but |
| 688 | +these methods do not print any messages (which makes debugging difficult) and |
| 689 | +they do *not* terminate the test immediately. |
690 | 690 |
|
691 | 691 | * `pass()` - test passed |
692 | 692 | * `fail()` - test failed |
693 | 693 | * `skip()` - test skipped |
694 | 694 | * `expire()` - test timed out [*] |
695 | 695 |
|
| 696 | +In most cases, the `failTestNow()`, `skipTestNow()` and `expireTestNow()` macros |
| 697 | +are more useful than the equivalent methods in the `Test` class. However, in a |
| 698 | +testing() loop test, the pass() method is probably better than the passTestNow() |
| 699 | +macro because we usually don't want to see an error message for a test that |
| 700 | +passes. |
| 701 | + |
696 | 702 | ***ArduinoUnit Compatibility***: _ |
697 | | -_The method(s) marked by [*] are only available in AUnit. For most cases, |
698 | | -the failNow(), skipNow() and expireNow() methods are recommended over the |
699 | | -methods from ArduinoUnit which have been carried over for compatibility and for |
700 | | -internal use. In a testing() loop test, the pass() method may be more useful |
701 | | -than the passNow() macro._ |
| 703 | +_The method(s) marked by [*] are only available in AUnit._ |
702 | 704 |
|
703 | 705 | ### Overridable Methods |
704 | 706 |
|
|
0 commit comments