FCF_TEST_PART_ORDER macro
Package: fcfTest
File: test.hpp
Available from version: 1.0.1
Registers a deterministic execution priority for a specific test part. Lower integer values indicate higher priority (run earlier).
The
The test runner sorts all registered parts based on the provided
Arguments
- The exact string name of the test part to prioritize.
- An integer representing the execution priority. Lower values are executed first.
Example:
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
FCF_TEST_DEFINE ("Core", "Main", "Test"){
}
FCF_TEST_DEFINE ("UI", "Main", "Test"){
}
FCF_TEST_DEFINE ("Integration", "Main", "Test"){
}
// "Core" tests will run before "UI" tests
FCF_TEST_PART_ORDER ("Core", 1);
FCF_TEST_PART_ORDER ("UI", 2);
// "Integration" tests will run after "Core" and "UI"
FCF_TEST_PART_ORDER ("Integration", 10);
int main(int a_argc, char* a_argv[]){
bool error;
fcf::NTest::cmdRun (a_argc, a_argv, fcf::NTest::CRM_RUN , &error);
return error ? 1 : 0;
}
Output:
Performing the test: "Core" -> "Main" -> "Test" ...
[SUCCESS] Test completed successfully (0.000`000`388 sec)
Performing the test: "UI" -> "Main" -> "Test" ...
[SUCCESS] Test completed successfully (0.000`000`225 sec)
Performing the test: "Integration" -> "Main" -> "Test" ...
[SUCCESS] Test completed successfully (0.000`000`208 sec)
[SUCCESS] All tests were completed.
Tests: 3 passed, 0 failed, 0 skipped, 3 total
Duration: 0.000`000`821 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.