| the Compartmented Robust Posix C++ Unit Test system |
|
|---|
Dependency access for a whole testsuite.
Used in: a DEPENDS_ON(...)
modifier for either a TEST(name, ...)
or a TESTSUITE(name, ...).
Example: The test program
#include <crpcut.hpp>
TESTSUITE(partial)
{
TEST(success_by_nothing) { }
TEST(fail) { FAIL << "oops"; }
}
TESTSUITE(full)
{
TEST(success_by_nothing) {}
}
TEST(failed_depend, DEPENDS_ON(ALL_TESTS(partial)))
{
// do nothing
}
TEST(successful_depend, DEPENDS_ON(ALL_TESTS(full)))
{
// do nothing
}
int main(int argc, char *argv[])
{
return crpcut::run(argc, argv);
}
reports one test that has not run:
FAILED!: partial::fail
phase="running" --------------------------------------------------------------
samples/all_tests.cpp:34
oops
-------------------------------------------------------------------------------
===============================================================================
The following tests were blocked from running:
!failed_depend
5 test cases selected
Sum Critical Non-critical
PASSED : 3 3 0
FAILED : 1 1 0
UNTESTED : 1