FCF 2.0 development in progress...
> > > > > >
[News] [C++ Libraries API] [C++ Downloads] [Donate to the project] [Contacts]

groupOrder from class fcf::NTest::Test

Property: groupOrder = FCF_TEST_ORDER_DEFAULT

Type: void

Class: fcf::NTest::Test

Package: fcfTest

File: test.hpp

Available from version: 1.2.1

Sets the execution priority for a specific group.

The groupOrder property allows you to define the order in which groups are executed within a single part.

This is useful when certain groups of tests within a module have dependencies on others, or when you want to prioritize specific functional areas during a test run.

Example: Ordering Groups within a Part

Demonstrating how to use FCF_TEST_GROUP_ORDER to control group execution sequence.

#define FCF_TEST_IMPLEMENTATION #include <fcfTest/test.hpp> FCF_TEST_DEFINE("Auth", "Login", "Test1") { const fcf::NTest::Test& test = fcf::NTest::state().test(); fcf::NTest::log() << "Group order: '" << test.groupOrder << std::endl; FCF_TEST(true); } FCF_TEST_DEFINE("Auth", "Logout", "Test2") { const fcf::NTest::Test& test = fcf::NTest::state().test(); fcf::NTest::log() << "Group order: '" << test.groupOrder << std::endl; FCF_TEST(true); } // Ensure 'Login' group runs before 'Logout' group FCF_TEST_GROUP_ORDER("Login", 1); FCF_TEST_GROUP_ORDER("Logout", 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: "Auth" -> "Login" -> "Test1" ... [SUCCESS] Test completed successfully (0.000`000`100 sec) Performing the test: "Auth" -> "Logout" -> "Test2" ... [SUCCESS] Test completed successfully (0.000`000`100 sec) [SUCCESS] All tests were completed. Tests: 2 passed, 0 failed, 0 skipped, 2 total Duration: 0.000`000`200 sec