From eb39946a2982cfca707b8aab9ff5412e8cb4c74b Mon Sep 17 00:00:00 2001 From: Brian Park Date: Wed, 24 Feb 2021 14:31:45 -0800 Subject: [PATCH 1/5] */Makefile: Replace 'make' with $(MAKE) for better FreeBSD compatibility --- examples/Makefile | 4 ++-- tests/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 3e96c8f..1653f73 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -2,7 +2,7 @@ all: set -e; \ for i in */Makefile; do \ echo '==== Making:' $$(dirname $$i); \ - make -C $$(dirname $$i) -j; \ + $(MAKE) -C $$(dirname $$i) -j; \ done # Don't 'set -e' because some of these tests are expected to fail @@ -16,5 +16,5 @@ clean: set -e; \ for i in */Makefile; do \ echo '==== Cleaning:' $$(dirname $$i); \ - make -C $$(dirname $$i) clean; \ + $(MAKE) -C $$(dirname $$i) clean; \ done diff --git a/tests/Makefile b/tests/Makefile index b9f4c8b..c7ab90d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,7 +10,7 @@ SetupAndTeardownTest tests: set -e; \ for dir in $(PASSING_TESTS) $(FAILING_TESTS); do \ - make -C $$dir -j; \ + $(MAKE) -C $$dir -j; \ done # $ make runtests | grep failed @@ -34,5 +34,5 @@ clean: set -e; \ for dir in $(PASSING_TESTS) $(FAILING_TESTS); do \ echo $$dir; \ - make -C $$dir clean; \ + $(MAKE) -C $$dir clean; \ done From 91d93c1ca54a6f6d6521bcf042a6a2a277a03511 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Fri, 26 Feb 2021 12:12:45 -0800 Subject: [PATCH 2/5] src/Assert{,Verbose}Macros.h: Implement assertNoFatalFailure(statement) macro; fixes #11 --- CHANGELOG.md | 3 ++ README.md | 53 +++++++++++++-------------------- examples/fixture/fixture.ino | 14 ++++----- keywords.txt | 1 + src/aunit/AssertMacros.h | 11 +++++++ src/aunit/AssertVerboseMacros.h | 11 +++++++ tests/AUnitTest/AUnitTest.ino | 22 +++++++------- 7 files changed, 64 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa5569..abb5f3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog * Unreleased + * Implement `assertNoFatalFailure(statement)` macro to prevent continued + execution if `statement` contains assertion failures. Fixes + [Issue #11](https://github.com/bxparks/AUnit/issues/11). * 1.5.3 (2021-02-23) * I botched the 1.5.2 release. Try again as 1.5.3. * 1.5.2 (2021-02-23) diff --git a/README.md b/README.md index 6ef3179..aaed601 100644 --- a/README.md +++ b/README.md @@ -862,57 +862,46 @@ method only. The statement after the `assertCustomStuff()` will continue to execute. In other words, in the following example, if the `assertCustomStuff()` fails, -then `doStuff()` inside `testF()` will execute: +then `assertMoreStuff()` inside `testF()` will execute: ```C++ class CustomTestOnce: public TestOnce { protected: - // optional - void setup() override { - TestOnce::setup(); - ...setup code... - } - - // optional - void teardown() override { - ...teardown code... - TestOnce::teardown(); - } - void assertCustomStuff() { assertEqual(sharedValue, 3); - // This will not execute if the assertEqual() failed. + // This will not execute if the assertEqual() above fails. assertLess(...); } + void assertMoreStuff() { + assertEqual(...); + } + int sharedValue; }; -testF(CustomTestOnce, calculate) { +// DON'T DO THIS +testF(CustomTestOnce, dontDoThis) { assertCustomStuff(); - // This will execute even if assertCustomStuff() failed. - doStuff(); - - // This will immediately exit this method if assertCustomStuff() failed. - assertTrue(true); + // This will execute even if assertCustomStuff() fails. + assertMoreStuff(); +} - // This will NOT execute if assertCustomStuff() failed. - doMoreStuff(); +// DO THIS INSTEAD +testF(CustomTestOnce, doThis) { + assertNoFatalFailure(assertCustomStuff()); + assertNoFatalFailure(assertMoreStuff()); } ``` -AUnit tries to mitigate this problem by having every `assertXxx()` macro -perform a check to see if a previous assert statement raise an error condition -for the test. If so, then the assert macro immediately exits. In the code above, -`doMoreStuff()` will not execute, because the `assertNotEqual()` will immidately -exit upon detecting the failure of `assertCustomStuff()`. - -Google Test has a -[ASSERT_NO_FATAL_FAILURE( statement)](https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md) -macro that can guard against this possibility. AUnit does not have that macro, -but we get the equivalent effect by doing a `assertTrue(true)` shown above. +The solution is to use the `assertNoFatalFailure(statement)` macro which checks +whether the inner `statement` returned with a fatal assertion. If so, then it +returns immediately, preventing execution from continuing to the code that +follows. This macro is modeled after the +[ASSERT_NO_FATAL_FAILURE(statement)](https://github.com/google/googletest/blob/master/docs/advanced.md) +macro in Google Test that provides the same functionality. ### Meta Assertions diff --git a/examples/fixture/fixture.ino b/examples/fixture/fixture.ino index 267d3c8..7374709 100644 --- a/examples/fixture/fixture.ino +++ b/examples/fixture/fixture.ino @@ -77,18 +77,18 @@ testF(LogTest, insert) { // Very useful for debugging assertRecords() // enableVerbosity(Verbosity::kAssertionPassed); - assertRecords(2, "bike", 1, "car", 2); + // The assertNoFatalFailure() macro prevents execution from continuing if + // assertRecords() contains a failure. + assertNoFatalFailure(assertRecords(2, "bike", 1, "car", 2)); - // Warning: This statement will execute even if assertRecords() fails. See - // README.md about "early returns" from assert statements. + // The assertNoFatalFailure() above prevents this statement from executing if + // assertRecords() fails. container.insert("train", 3); - // This assert will return immediately if assertRecords() fails. See - // README.md about delayed status verification. + // This assert will return immediately upon failure. assertEqual(3, container.numRecords); - // This statement will not execute if assertRecords() fails because the - // above assertEqual() will return. + // This statement will not execute if the above assertEqual() fails. container.insert("plane", 4); } diff --git a/keywords.txt b/keywords.txt index c090787..b52c620 100644 --- a/keywords.txt +++ b/keywords.txt @@ -84,6 +84,7 @@ assertTrue KEYWORD2 assertFalse KEYWORD2 assertNear KEYWORD2 assertNotNear KEYWORD2 +assertNoFatalFailure KEYWORD2 # Public macros from MetaAssertMacros.h checkTestDone KEYWORD2 diff --git a/src/aunit/AssertMacros.h b/src/aunit/AssertMacros.h index f41135a..e6c74bf 100644 --- a/src/aunit/AssertMacros.h +++ b/src/aunit/AssertMacros.h @@ -100,4 +100,15 @@ SOFTWARE. return;\ } while (false) +/** + * Assert that the inner 'statement' returns with no fatal assertions. This is + * required because AUnit does not use exceptions, so we have to check the + * assertion state after calling an inner function. This macro is similar to + * the `ASSERT_NO_FATAL_FAILURE(statement)` in GoogleTest. + */ +#define assertNoFatalFailure(statement) do { \ + statement; \ + if (isDone()) return; \ +} while (false) + #endif diff --git a/src/aunit/AssertVerboseMacros.h b/src/aunit/AssertVerboseMacros.h index 7001904..9da075c 100644 --- a/src/aunit/AssertVerboseMacros.h +++ b/src/aunit/AssertVerboseMacros.h @@ -105,4 +105,15 @@ SOFTWARE. return;\ } while (false) +/** + * Assert that the inner 'statement' returns with no fatal assertions. This is + * required because AUnit does not use exceptions, so we have to check the + * assertion state after calling an inner function. This macro is similar to + * the `ASSERT_NO_FATAL_FAILURE(statement)` in GoogleTest. + */ +#define assertNoFatalFailure(statement) do { \ + statement; \ + if (isDone()) return; \ +} while (false) + #endif diff --git a/tests/AUnitTest/AUnitTest.ino b/tests/AUnitTest/AUnitTest.ino index baf61d8..8af0b2e 100644 --- a/tests/AUnitTest/AUnitTest.ino +++ b/tests/AUnitTest/AUnitTest.ino @@ -48,11 +48,9 @@ SOFTWARE. #endif -// Defined in ESP8266, not defined in AVR or Teensy, broken in ESP32. -#if !defined(ESP8266) - #undef FPSTR - #define FPSTR(pstr_pointer) \ - (reinterpret_cast(pstr_pointer)) +// Defined in ESP8266 and ESP32, not defined in AVR or Teensy. +#ifndef FPSTR + #define FPSTR(pstr) (reinterpret_cast(pstr)) #endif signed char sc = 4; @@ -603,7 +601,7 @@ class CustomOnceFixture: public TestOnce { TestOnce::teardown(); } - void assertCommon(int m) { + void testCommon(int m) { assertLess(m, subject); } @@ -615,7 +613,7 @@ class CustomOnceFixture: public TestOnce { }; testF(CustomOnceFixture, common) { - assertCommon(5); + assertNoFatalFailure(testCommon(5)); assertEqual(6, subject); } @@ -630,7 +628,7 @@ class CustomAgainFixture: public TestAgain { TestAgain::teardown(); } - void assertCommon(int m) { + void testCommon(int m) { assertLess(m, subject); } @@ -638,7 +636,7 @@ class CustomAgainFixture: public TestAgain { }; testingF(CustomAgainFixture, common) { - assertCommon(5); + assertNoFatalFailure(testCommon(5)); assertEqual(6, subject); pass(); } @@ -651,7 +649,7 @@ testingF(CustomAgainFixture, common) { // because testingF() overrides an again() method which doesn't exist in // TestOnce. testingF(CustomOnceFixture, crossedOnce) { - assertCommon(); + testCommon(); } #endif @@ -659,7 +657,7 @@ testingF(CustomOnceFixture, crossedOnce) { // Test a testF() macro with a TestAgain class. Should get compiler error // because testF() overrides a once() method which doesn't exist in TestAgain. testF(CustomAgainFixture, crossedAgain) { - assertCommon(); + testCommon(); } #endif @@ -692,7 +690,7 @@ class CustomTestOnce: public TestOnce { CustomTestOnce myTestOnce1("customTestOnce1"); CustomTestOnce myTestOnce2("customTestOnce2"); -#endif +#endif // USE_AUNIT // ------------------------------------------------------ // The main body. From cb4ba2e39efcfd70f6160b21018fc67b1966cf84 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 2 Mar 2021 14:17:59 -0800 Subject: [PATCH 3/5] CHANGELOG.md: Fix version number when I added the symlink, it was v1.3.1 not v1.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abb5f3f..6d4727f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ a symlink to a regular file. The Arduino Library Manager apparently does not allow symlinks (see https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ). So when I - created the symlink at v1.3 on 2019-06-05, the Library Manager stopped + created the symlink at v1.3.1 on 2019-07-31, the Library Manager stopped updating the library for almost 2 years, until I removed the symlink at v1.5.2. * No functional change in this release. From 8ea439cc3ac99c73125a950d426fd200d28d2db1 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 2 Mar 2021 14:20:47 -0800 Subject: [PATCH 4/5] Bump version to 1.5.4 --- CHANGELOG.md | 1 + README.md | 2 +- docs/doxygen.cfg | 2 +- library.properties | 2 +- src/AUnit.h | 4 ++-- src/AUnitVerbose.h | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4727f..6d8aa27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog * Unreleased +* 1.5.4 (2021-03-02) * Implement `assertNoFatalFailure(statement)` macro to prevent continued execution if `statement` contains assertion failures. Fixes [Issue #11](https://github.com/bxparks/AUnit/issues/11). diff --git a/README.md b/README.md index aaed601..989c8ae 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ instead of having to go through the Arduino IDE. Both the AUniter and EpoxyDuino tools can be used in a continuous integration system like Jenkins, or with [GitHub Actions](https://github.com/features/actions). -**Version**: 1.5.3 (2021-02-23) +**Version**: 1.5.4 (2021-03-02) **Changelog**: [CHANGELOG.md](CHANGELOG.md) diff --git a/docs/doxygen.cfg b/docs/doxygen.cfg index dd43c0f..5ec13f3 100644 --- a/docs/doxygen.cfg +++ b/docs/doxygen.cfg @@ -38,7 +38,7 @@ PROJECT_NAME = "AUnit" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.5.3 +PROJECT_NUMBER = 1.5.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/library.properties b/library.properties index b294690..535c7c4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AUnit -version=1.5.3 +version=1.5.4 author=Brian T. Park maintainer=Brian T. Park sentence=A unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. diff --git a/src/AUnit.h b/src/AUnit.h index fbfda08..e1346c3 100644 --- a/src/AUnit.h +++ b/src/AUnit.h @@ -69,7 +69,7 @@ SOFTWARE. #include "aunit/TestMacros.h" // Version format: xxyyzz == "xx.yy.zz" -#define AUNIT_VERSION 10503 -#define AUNIT_VERSION_STRING "1.5.3" +#define AUNIT_VERSION 10504 +#define AUNIT_VERSION_STRING "1.5.4" #endif diff --git a/src/AUnitVerbose.h b/src/AUnitVerbose.h index cdc22a4..d9361e8 100644 --- a/src/AUnitVerbose.h +++ b/src/AUnitVerbose.h @@ -59,7 +59,7 @@ SOFTWARE. #include "aunit/TestMacros.h" // Version format: xxyyzz == "xx.yy.zz" -#define AUNIT_VERSION 10503 -#define AUNIT_VERSION_STRING "1.5.3" +#define AUNIT_VERSION 10504 +#define AUNIT_VERSION_STRING "1.5.4" #endif From 923c4a5fce753b7caeb4ec567f4461061634df9a Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 2 Mar 2021 14:21:37 -0800 Subject: [PATCH 5/5] docs: Regenerate doxygen docs for v1.5.4 --- docs/html/AUnitVerbose_8h.html | 6 +- docs/html/AUnitVerbose_8h_source.html | 6 +- docs/html/AUnit_8h.html | 6 +- docs/html/AUnit_8h_source.html | 6 +- docs/html/AssertMacros_8h.html | 32 +++++++- docs/html/AssertMacros_8h_source.html | 9 ++- docs/html/AssertVerboseMacros_8h.html | 32 +++++++- docs/html/AssertVerboseMacros_8h_source.html | 9 ++- docs/html/Assertion_8cpp_source.html | 2 +- docs/html/Assertion_8h_source.html | 2 +- docs/html/Compare_8cpp_source.html | 2 +- docs/html/Compare_8h.html | 2 +- docs/html/Compare_8h_source.html | 2 +- docs/html/FCString_8cpp_source.html | 2 +- docs/html/FCString_8h_source.html | 2 +- docs/html/FakePrint_8h_source.html | 2 +- docs/html/Flash_8h.html | 2 +- docs/html/Flash_8h_source.html | 2 +- docs/html/MetaAssertMacros_8h.html | 2 +- docs/html/MetaAssertMacros_8h_source.html | 2 +- docs/html/MetaAssertion_8cpp_source.html | 2 +- docs/html/MetaAssertion_8h_source.html | 2 +- docs/html/Printer_8cpp_source.html | 2 +- docs/html/Printer_8h_source.html | 2 +- docs/html/TestAgain_8cpp_source.html | 2 +- docs/html/TestAgain_8h_source.html | 2 +- docs/html/TestMacros_8h.html | 2 +- docs/html/TestMacros_8h_source.html | 2 +- docs/html/TestOnce_8cpp_source.html | 2 +- docs/html/TestOnce_8h_source.html | 2 +- docs/html/TestRunner_8cpp_source.html | 2 +- docs/html/TestRunner_8h_source.html | 2 +- docs/html/Test_8cpp_source.html | 2 +- docs/html/Test_8h_source.html | 2 +- docs/html/Verbosity_8h_source.html | 2 +- docs/html/annotated.html | 2 +- .../html/classaunit_1_1Assertion-members.html | 2 +- docs/html/classaunit_1_1Assertion.html | 2 +- .../classaunit_1_1MetaAssertion-members.html | 2 +- docs/html/classaunit_1_1MetaAssertion.html | 2 +- docs/html/classaunit_1_1Printer-members.html | 2 +- docs/html/classaunit_1_1Printer.html | 2 +- docs/html/classaunit_1_1Test-members.html | 2 +- docs/html/classaunit_1_1Test.html | 2 +- .../html/classaunit_1_1TestAgain-members.html | 2 +- docs/html/classaunit_1_1TestAgain.html | 2 +- docs/html/classaunit_1_1TestOnce-members.html | 2 +- docs/html/classaunit_1_1TestOnce.html | 2 +- .../classaunit_1_1TestRunner-members.html | 2 +- docs/html/classaunit_1_1TestRunner.html | 2 +- .../html/classaunit_1_1Verbosity-members.html | 2 +- docs/html/classaunit_1_1Verbosity.html | 2 +- ...assaunit_1_1fake_1_1FakePrint-members.html | 2 +- .../html/classaunit_1_1fake_1_1FakePrint.html | 2 +- ...aunit_1_1internal_1_1FCString-members.html | 2 +- .../classaunit_1_1internal_1_1FCString.html | 2 +- docs/html/classes.html | 2 +- docs/html/dir_000000_000001.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- .../dir_81cd3825682eb05918933587e078c005.html | 2 +- .../dir_9268cfe6e304750d3a96b29cda140489.html | 2 +- .../dir_dc26540604d17911199600d9c2812a4e.html | 2 +- docs/html/files.html | 2 +- docs/html/functions.html | 2 +- docs/html/functions_func.html | 2 +- docs/html/functions_type.html | 2 +- docs/html/functions_vars.html | 2 +- docs/html/globals.html | 10 ++- docs/html/globals_defs.html | 10 ++- docs/html/graph_legend.html | 2 +- docs/html/gtest_8h.html | 2 +- docs/html/gtest_8h_source.html | 2 +- docs/html/hierarchy.html | 2 +- docs/html/index.html | 2 +- docs/html/inherits.html | 2 +- ...brian_src_AUnit_src_aunit_fake_README.html | 2 +- docs/html/pages.html | 2 +- docs/html/print64_8cpp_source.html | 2 +- docs/html/print64_8h.html | 2 +- docs/html/print64_8h_source.html | 2 +- docs/html/search/all_0.js | 69 ++++++++-------- docs/html/search/all_1.js | 46 +++++------ docs/html/search/all_2.js | 2 +- docs/html/search/all_3.js | 16 ++-- docs/html/search/all_4.js | 12 +-- docs/html/search/all_5.js | 24 +++--- docs/html/search/all_6.js | 28 +++---- docs/html/search/all_7.js | 46 +++++------ docs/html/search/all_8.js | 4 +- docs/html/search/all_9.js | 4 +- docs/html/search/all_a.js | 2 +- docs/html/search/all_b.js | 12 +-- docs/html/search/all_c.js | 4 +- docs/html/search/all_d.js | 18 ++--- docs/html/search/all_e.js | 20 ++--- docs/html/search/all_f.js | 2 +- docs/html/search/classes_0.js | 2 +- docs/html/search/classes_1.js | 4 +- docs/html/search/classes_2.js | 2 +- docs/html/search/classes_3.js | 2 +- docs/html/search/classes_4.js | 8 +- docs/html/search/classes_5.js | 2 +- docs/html/search/defines_0.js | 79 ++++++++++--------- docs/html/search/defines_1.js | 40 +++++----- docs/html/search/defines_2.js | 10 +-- docs/html/search/defines_3.js | 2 +- docs/html/search/defines_4.js | 2 +- docs/html/search/defines_5.js | 2 +- docs/html/search/defines_6.js | 8 +- docs/html/search/files_0.js | 8 +- docs/html/search/files_1.js | 2 +- docs/html/search/files_2.js | 2 +- docs/html/search/files_3.js | 2 +- docs/html/search/files_4.js | 2 +- docs/html/search/files_5.js | 2 +- docs/html/search/files_6.js | 2 +- docs/html/search/functions_0.js | 16 ++-- docs/html/search/functions_1.js | 4 +- docs/html/search/functions_2.js | 2 +- docs/html/search/functions_3.js | 6 +- docs/html/search/functions_4.js | 4 +- docs/html/search/functions_5.js | 22 +++--- docs/html/search/functions_6.js | 28 +++---- docs/html/search/functions_7.js | 4 +- docs/html/search/functions_8.js | 2 +- docs/html/search/functions_9.js | 2 +- docs/html/search/functions_a.js | 6 +- docs/html/search/functions_b.js | 4 +- docs/html/search/functions_c.js | 16 ++-- docs/html/search/functions_d.js | 8 +- docs/html/search/pages_0.js | 2 +- docs/html/search/pages_1.js | 2 +- docs/html/search/typedefs_0.js | 2 +- docs/html/search/variables_0.js | 46 +++++------ docs/html/string__util_8cpp_source.html | 2 +- docs/html/string__util_8h_source.html | 2 +- 136 files changed, 509 insertions(+), 429 deletions(-) diff --git a/docs/html/AUnitVerbose_8h.html b/docs/html/AUnitVerbose_8h.html index a895c8d..c28694f 100644 --- a/docs/html/AUnitVerbose_8h.html +++ b/docs/html/AUnitVerbose_8h.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -120,10 +120,10 @@

Macros

-#define AUNIT_VERSION   10503 +#define AUNIT_VERSION   10504   -#define AUNIT_VERSION_STRING   "1.5.3" +#define AUNIT_VERSION_STRING   "1.5.4"  

Detailed Description

diff --git a/docs/html/AUnitVerbose_8h_source.html b/docs/html/AUnitVerbose_8h_source.html index 87a4819..bb34343 100644 --- a/docs/html/AUnitVerbose_8h_source.html +++ b/docs/html/AUnitVerbose_8h_source.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -122,8 +122,8 @@
59 #include "aunit/TestMacros.h"
60 
61 // Version format: xxyyzz == "xx.yy.zz"
-
62 #define AUNIT_VERSION 10503
-
63 #define AUNIT_VERSION_STRING "1.5.3"
+
62 #define AUNIT_VERSION 10504
+
63 #define AUNIT_VERSION_STRING "1.5.4"
64 
65 #endif
diff --git a/docs/html/AUnit_8h.html b/docs/html/AUnit_8h.html index 964bf4b..6295551 100644 --- a/docs/html/AUnit_8h.html +++ b/docs/html/AUnit_8h.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -120,10 +120,10 @@

Macros

-#define AUNIT_VERSION   10503 +#define AUNIT_VERSION   10504   -#define AUNIT_VERSION_STRING   "1.5.3" +#define AUNIT_VERSION_STRING   "1.5.4"  

Detailed Description

diff --git a/docs/html/AUnit_8h_source.html b/docs/html/AUnit_8h_source.html index fab389c..327a56f 100644 --- a/docs/html/AUnit_8h_source.html +++ b/docs/html/AUnit_8h_source.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -122,8 +122,8 @@
69 #include "aunit/TestMacros.h"
70 
71 // Version format: xxyyzz == "xx.yy.zz"
-
72 #define AUNIT_VERSION 10503
-
73 #define AUNIT_VERSION_STRING "1.5.3"
+
72 #define AUNIT_VERSION 10504
+
73 #define AUNIT_VERSION_STRING "1.5.4"
74 
75 #endif
diff --git a/docs/html/AssertMacros_8h.html b/docs/html/AssertMacros_8h.html index 651ecba..06ee661 100644 --- a/docs/html/AssertMacros_8h.html +++ b/docs/html/AssertMacros_8h.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -139,6 +139,9 @@ #define assertNotNear(arg1, arg2, error)  Assert that arg1 and arg2 are NOT within error of each other. More...
  +#define assertNoFatalFailure(statement) + Assert that the inner 'statement' returns with no fatal assertions. More...

Detailed Description

Various assertion macros (assertXxx()) are defined in this header. These macros can be used only in a subclass of TestOnce or TestAgain, which is true for all tests created by test(), testing(), testF() and testingF().

@@ -222,6 +225,33 @@

Definition at line 90 of file AssertMacros.h.

+

+ + +

◆ assertNoFatalFailure

+ +
+
+ + + + + + + + +
#define assertNoFatalFailure( statement)
+
+Value:
do { \
+
statement; \
+
if (isDone()) return; \
+
} while (false)
+
+

Assert that the inner 'statement' returns with no fatal assertions.

+

This is required because AUnit does not use exceptions, so we have to check the assertion state after calling an inner function. This macro is similar to the ASSERT_NO_FATAL_FAILURE(statement) in GoogleTest.

+ +

Definition at line 109 of file AssertMacros.h.

+
diff --git a/docs/html/AssertMacros_8h_source.html b/docs/html/AssertMacros_8h_source.html index ca79d12..efac4d1 100644 --- a/docs/html/AssertMacros_8h_source.html +++ b/docs/html/AssertMacros_8h_source.html @@ -22,7 +22,7 @@
AUnit -  1.5.3 +  1.5.4
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
@@ -151,7 +151,12 @@
100  return;\
101 } while (false)
102 
-
103 #endif
+
109 #define assertNoFatalFailure(statement) do { \
+
110  statement; \
+
111  if (isDone()) return; \
+
112 } while (false)
+
113 
+
114 #endif