Specifies a list of fixtures for which the test is to be treated as a cleanup test. These fixture names are distinct from test case names and are not required to have any similarity to the names of tests associated with them.
Fixture cleanup tests are ordinary tests with all of the usual test functionality. Setting the FIXTURES_CLEANUP property for a test has two primary effects:
A cleanup test can have multiple fixtures listed in its FIXTURES_CLEANUP property. It will execute only once for the whole CTest run, not once for each fixture. A fixture can also have more than one cleanup test defined. If there are multiple cleanup tests for a fixture, projects can control their order with the usual DEPENDS test property if necessary.
A cleanup test is allowed to require other fixtures, but not any fixture listed in its FIXTURES_CLEANUP property. For example:
# Ok: Dependent fixture is different to cleanup
set_tests_properties(cleanupFoo PROPERTIES
FIXTURES_CLEANUP Foo
FIXTURES_REQUIRED Bar
)
# Error: cannot require same fixture as cleanup
set_tests_properties(cleanupFoo PROPERTIES
FIXTURES_CLEANUP Foo
FIXTURES_REQUIRED Foo
)
Cleanup tests will execute even if setup or regular tests for that fixture fail or are skipped.
See FIXTURES_REQUIRED for a more complete discussion of how to use test fixtures.