testOrder from class fcf::NTest::Test
Type:
Class:
Package: fcfTest
File: test.hpp
Available from version: 1.2.2
The execution priority of the specific test case.
The
By using the
Example: Ordering Individual Tests
Demonstrating how to use
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
FCF_TEST_DEFINE ("App", "UI", "ButtonTest") {
const fcf::NTest::Test & test = fcf::NTest::state ().test ();
fcf::NTest::log () << "Name order: '" << test.testOrder << std::endl;
FCF_TEST (true);
}
FCF_TEST_DEFINE ("App", "UI", "MenuTest") {
const fcf::NTest::Test & test = fcf::NTest::state ().test ();
fcf::NTest::log () << "Name order: '" << test.testOrder << std::endl;
FCF_TEST (true);
}
// Force 'MenuTest' to run before 'ButtonTest'
FCF_TEST_TEST_ORDER ("MenuTest", 1);
FCF_TEST_TEST_ORDER ("ButtonTest", 2);
int main(int a_argc, char* a_argv[]) {
bool error = false;
fcf::NTest::cmdRun (a_argc, a_argv, fcf::NTest::CRM_RUN , &error);
return error ? 1 : 0;
}
Output:
Performing the test: "App" -> "UI" -> "MenuTest" ...
> Name order: '1
[SUCCESS] Test completed successfully (0.000`006`711 sec)
Performing the test: "App" -> "UI" -> "ButtonTest" ...
> Name order: '2
[SUCCESS] Test completed successfully (0.000`001`883 sec)
[SUCCESS] All tests were completed.
Tests: 2 passed, 0 failed, 0 skipped, 2 total
Duration: 0.000`008`594 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.