Test Executor

When tests are registered (via ctest’s add_test()), a “test executor” (cmake script) is requested executed. The executor is then responsible for invoking the actual test callback, that has been specified via define_test(). In addition, the executor is also responsible for executing eventual before and after callbacks, for the test case.

Location

The executor can be found at: rsp/testing/executor.cmake.

Custom Executor

To use a custom executor, set the path to your executor via the RSP_TEST_EXECUTOR_PATH property. This SHOULD be done before specifying your test suites.

# ...in your /tests/CMakeLists.txt

enable_testing()

project(my_package_tests LANGUAGES NONE)

include("rsp/testing")

# Set path to custom test executor
set(RSP_TEST_EXECUTOR_PATH "../cmake/my_custom_test_executor.cmake")

define_test_suite("unit" DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/unit")