Skip to content

Commit

Permalink
Merge pull request #27 from bxparks/develop
Browse files Browse the repository at this point in the history
0.5.2 - rename XxxNow() to XxxTestNow() to avoid name collisions
  • Loading branch information
bxparks authored May 8, 2018
2 parents 0a84107 + 7f277a0 commit f299efe
Show file tree
Hide file tree
Showing 120 changed files with 1,235 additions and 239 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

* 0.5.2 (2018-05-08)
* Rename failNow(), passNow(), skipNow(), expireNow() macros to
failTestNow(), passTestNow(), skipTestNow(), expireTestNow() to reduce
the chance of name collision.
* 0.5.1 (2018-05-01)
* Support ESP32.
* Add failNow(), passNow(), skipNow() and expireNow() macros.
Expand Down
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A unit testing framework for Arduino platforms inspired by ArduinoUnit and
Google Test.

Version: 0.5.1 (2018-05-01)
Version: 0.5.2 (2018-05-08)

## Summary

Expand Down Expand Up @@ -87,10 +87,10 @@ Here are the features in AUnit which are not available in ArduinoUnit:
* `externTestF()`
* `externTestingF()`
* Status setters
* `passNow()`
* `failNow()`
* `skipNow()`
* `expireNow()`
* `passTestNow()`
* `failTestNow()`
* `skipTestNow()`
* `expireTestNow()`
* `teardown()` method, mirroring the `setup()`
* `teardown()`
* Tested on the following Arduino platforms:
Expand Down Expand Up @@ -251,9 +251,9 @@ testing(looping_test) {
if (...) {
pass();
} else if (...) {
failNow();
failTestNow();
} else {
skipNow();
skipTestNow();
}
}
Expand Down Expand Up @@ -664,41 +664,43 @@ AUnitTest.ino, line 439.
_AUnit has a separate message handler to print a customized message for the
assertTestXxx() meta assertion macros._

### Status Indicator Methods
### Unconditional Termination

The following macros can be used inside the body of `test()` or `testing()`
macro to indicate whether the test has passed or failed (or reached some other
status). Each macro prints a short message, and returns immediately from the
test, much like an `assertXxx()` macro that fails.
macro to terminate a test unconditionally. Each macro prints a short message,
and returns immediately from the test, much like an `assertXxx()` macro that
fails.

* `passNow()` [*]
* `failNow()` [*]
* `skipNow()` [*]
* `expireNow()` [*]
* `passTestNow()` [*]
* `failTestNow()` [*]
* `skipTestNow()` [*]
* `expireTestNow()` [*]

The message looks like:
The messages look like:
```
Status timed out, file AUnitTest.ino, line 381.
Status failed, file AUnitTest.ino, line 378.
Status passed, file AUnitTest.ino, line 360.
Status failed, file AUnitTest.ino, line 378.
Status skipped, file AUnitTest.ino, line 380.
Status timed out, file AUnitTest.ino, line 391.
```

The above methods are recommended over the following methods on the `Test` class
because the `xxxNow()` versions print the file and line number of the statement.
The methods on `Test` are completely silent which makes debugging difficult.
The following methods on the `Test` class also set the `status` of the test, but
these methods do not print any messages (which makes debugging difficult) and
they do *not* terminate the test immediately.

* `pass()` - test passed
* `fail()` - test failed
* `skip()` - test skipped
* `expire()` - test timed out [*]

In most cases, the `failTestNow()`, `skipTestNow()` and `expireTestNow()` macros
are more useful than the equivalent methods in the `Test` class. However, in a
testing() loop test, the pass() method is probably better than the passTestNow()
macro because we usually don't want to see an error message for a test that
passes.

***ArduinoUnit Compatibility***: _
_The method(s) marked by [*] are only available in AUnit. For most cases,
the failNow(), skipNow() and expireNow() methods are recommended over the
methods from ArduinoUnit which have been carried over for compatibility and for
internal use. In a testing() loop test, the pass() method may be more useful
than the passNow() macro._
_The method(s) marked by [*] are only available in AUnit._

### Overridable Methods

Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0.5.1
PROJECT_NUMBER = 0.5.2

# 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
Expand Down
12 changes: 6 additions & 6 deletions docs/html/AUnitVerbose_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">AUnit
&#160;<span id="projectnumber">0.5.1</span>
&#160;<span id="projectnumber">0.5.2</span>
</div>
<div id="projectbrief">Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.</div>
</td>
Expand Down Expand Up @@ -71,10 +71,10 @@
</div><!--header-->
<div class="contents">

<p>Same as <a class="el" href="AUnit_8h_source.html">AUnit.h</a> except that the verbose versions of the various assertXxx() macros are provided.
<p>Same as <a class="el" href="AUnit_8h.html" title="Same as AUnitVerbose.h except that the terse versions of the various assertXxx() macros are provided...">AUnit.h</a> except that the verbose versions of the various assertXxx() macros are provided.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;aunit/Verbosity.h&quot;</code><br />
<code>#include &quot;aunit/Compare.h&quot;</code><br />
<code>#include &quot;<a class="el" href="Compare_8h_source.html">aunit/Compare.h</a>&quot;</code><br />
<code>#include &quot;aunit/Printer.h&quot;</code><br />
<code>#include &quot;aunit/Test.h&quot;</code><br />
<code>#include &quot;aunit/Assertion.h&quot;</code><br />
Expand All @@ -91,7 +91,7 @@
<div class="center"><img src="AUnitVerbose_8h__incl.png" border="0" usemap="#_2home_2brian_2dev_2AUnit_2src_2AUnitVerbose_8h" alt=""/></div>
<map name="_2home_2brian_2dev_2AUnit_2src_2AUnitVerbose_8h" id="_2home_2brian_2dev_2AUnit_2src_2AUnitVerbose_8h">
<area shape="rect" id="node2" href="Verbosity_8h_source.html" title="aunit/Verbosity.h" alt="" coords="391,468,511,495"/>
<area shape="rect" id="node4" href="Compare_8h_source.html" title="aunit/Compare.h" alt="" coords="45,95,163,121"/>
<area shape="rect" id="node4" href="Compare_8h.html" title="This file provides overloaded compareXxx(a, b) functions which are used by the various assertXxx(a..." alt="" coords="45,95,163,121"/>
<area shape="rect" id="node6" href="Printer_8h_source.html" title="aunit/Printer.h" alt="" coords="365,319,467,345"/>
<area shape="rect" id="node7" href="Test_8h_source.html" title="aunit/Test.h" alt="" coords="439,393,529,420"/>
<area shape="rect" id="node9" href="Assertion_8h_source.html" title="aunit/Assertion.h" alt="" coords="492,319,612,345"/>
Expand All @@ -112,11 +112,11 @@
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a87cbb10969eff63f8ae66afc4e9457eb"><td class="memItemLeft" align="right" valign="top"><a id="a87cbb10969eff63f8ae66afc4e9457eb"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>AUNIT_VERSION</b>&#160;&#160;&#160;000501</td></tr>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>AUNIT_VERSION</b>&#160;&#160;&#160;000502</td></tr>
<tr class="separator:a87cbb10969eff63f8ae66afc4e9457eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Same as <a class="el" href="AUnit_8h_source.html">AUnit.h</a> except that the verbose versions of the various assertXxx() macros are provided. </p>
<div class="textblock"><p>Same as <a class="el" href="AUnit_8h.html" title="Same as AUnitVerbose.h except that the terse versions of the various assertXxx() macros are provided...">AUnit.h</a> except that the verbose versions of the various assertXxx() macros are provided. </p>
<p>These capture the strings of the actual arguments in the assert macros and print more verbose and helpful messages in the same format used by ArduinoUnit. The cost is 20-25% increase in flash memory to hold those strings for medium to large unit tests. </p>

<p class="definition">Definition in file <a class="el" href="AUnitVerbose_8h_source.html">AUnitVerbose.h</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/AUnitVerbose_8h__incl.map
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<map id="/home/brian/dev/AUnit/src/AUnitVerbose.h" name="/home/brian/dev/AUnit/src/AUnitVerbose.h">
<area shape="rect" id="node2" href="$Verbosity_8h_source.html" title="aunit/Verbosity.h" alt="" coords="391,468,511,495"/>
<area shape="rect" id="node4" href="$Compare_8h_source.html" title="aunit/Compare.h" alt="" coords="45,95,163,121"/>
<area shape="rect" id="node4" href="$Compare_8h.html" title="This file provides overloaded compareXxx(a, b) functions which are used by the various assertXxx(a..." alt="" coords="45,95,163,121"/>
<area shape="rect" id="node6" href="$Printer_8h_source.html" title="aunit/Printer.h" alt="" coords="365,319,467,345"/>
<area shape="rect" id="node7" href="$Test_8h_source.html" title="aunit/Test.h" alt="" coords="439,393,529,420"/>
<area shape="rect" id="node9" href="$Assertion_8h_source.html" title="aunit/Assertion.h" alt="" coords="492,319,612,345"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/AUnitVerbose_8h__incl.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
044106ba5bbe5761f934b018fc950f1a
858797fb3625711c6104d1d0cd8ef91f
Loading

0 comments on commit f299efe

Please sign in to comment.