Go to the documentation of this file.
37 bool _printOnPass = (getenv(
"PRINT_ON_PASS") != NULL);
39 unsigned _failures = 0;
41 bool _casePrinted =
false;
42 const char *_case = NULL;
49 checkVal(
const char *file,
const unsigned line,
50 const char *
test,
const bool result)
52 if (!result || _printOnPass) {
53 if (!_casePrinted && _case) {
57 cprintf(
" CHECK %s: %s:%d %s\n",
58 result ?
"PASSED" :
"FAILED", file, line,
test);
60 if (result) _passes++;
65 void printOnPass(
bool newPrintOnPass) { _printOnPass = newPrintOnPass; }
67 unsigned passes() {
return _passes; }
73 cprintf(
"TEST %s: %d checks passed, %d checks failed.\n",
74 _failures ?
"FAILED" :
"PASSED", _passes, _failures);
bool printOnPass()
Print on pass is a switch that specifies whether to print a message even when a check passes.
void reset()
Zero the number of passes and failures so far.
void setCase(const char *newCase)
Sets the current test case.
void cprintf(const char *format, const Args &...args)
unsigned printResults()
Function to call at the end of a test that prints an overall result and a summary of how many checks ...
unsigned passes()
Function that returns the current number of passed checks.
unsigned failures()
Function that returns the current number of failed checks.
void checkVal(const char *file, const unsigned line, const char *test, const bool result)
Function that actually handles checking whether an EXPECT_* passed.
Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17