28 #include "Verbosity.h"
30 #include "TestRunner.h"
31 #include "MetaAssertion.h"
37 const char MetaAssertion::kMessageDone[] PROGMEM =
"done";
38 const char MetaAssertion::kMessageNotDone[] PROGMEM =
"not done";
39 const char MetaAssertion::kMessagePassed[] PROGMEM =
"passed";
40 const char MetaAssertion::kMessageNotPassed[] PROGMEM =
"not passed";
41 const char MetaAssertion::kMessageFailed[] PROGMEM =
"failed";
42 const char MetaAssertion::kMessageNotFailed[] PROGMEM =
"not failed";
43 const char MetaAssertion::kMessageSkipped[] PROGMEM =
"skipped";
44 const char MetaAssertion::kMessageNotSkipped[] PROGMEM =
"not skipped";
45 const char MetaAssertion::kMessageExpired[] PROGMEM =
"timed out";
46 const char MetaAssertion::kMessageNotExpired[] PROGMEM =
"not timed out";
52 void printAssertionTestStatusMessage(
53 bool ok,
const char* file, uint16_t line,
54 const char* testName,
const __FlashStringHelper* statusMessage) {
61 printer->print(
": Assertion ");
62 printer->print(ok ?
"passed" :
"failed");
63 printer->print(F(
": Test "));
64 printer->print(testName);
65 printer->print(
" is ");
66 printer->print(statusMessage);
67 printer->println(
'.');
73 const char* testName,
const __FlashStringHelper* statusMessage,
bool ok) {
74 if (
isDone())
return false;
76 printAssertionTestStatusMessage(ok, file, line, testName, statusMessage);
86 void printStatusNowMessage(
const char* file, uint16_t line,
87 const __FlashStringHelper* statusString) {
94 printer->print(F(
": Status "));
95 printer->print(statusString);
96 printer->println(
'.');
109 uint8_t status,
const __FlashStringHelper* statusString) {
112 printStatusNowMessage(file, line, statusString);
This file provides overloaded compareXxx(a, b) functions which are used by the various assertXxx(a,...
Various macros to smooth over the differences among the various platforms with regards to their suppo...
bool isOutputEnabled(bool ok) const
Returns true if an assertion message should be printed.
static Print * getPrinter()
Get the output printer used by the various assertion() methods and the TestRunner.
bool isDone() const
Return true if test has been asserted.
static const uint8_t kStatusFailed
Test has failed, or fail() was called.
bool isVerbosity(uint8_t verbosity) const
Determine if any of the given verbosity is enabled.
void setStatus(uint8_t status)
Set the status of the test.
static const uint8_t kStatusPassed
Test has passed, or pass() was called.
static const uint8_t kStatusExpired
Test has timed out, or expire() called.
static const uint8_t kStatusSkipped
Test is skipped through the exclude() method or skip() was called.
void setPassOrFail(bool ok)
Set the status to Passed or Failed depending on ok.
static const uint8_t kTestFailed
Print test failed message.
static const uint8_t kTestPassed
Print test passed message.
static const uint8_t kTestSkipped
Print test skipped message.
static const uint8_t kTestExpired
Print test timed out message.