Files
Matthew Woehlke 4bbdabae74 Ninja, Makefile, FASTBuild: Enable test_prep by default
Enable test preparation targets by default. Add (better named)
`CMAKE_SKIP_TEST_PREP_TARGETS` variable to control generation of the
same, mirroring `CMAKE_SKIP_INSTALL_PREP_TARGETS`. Remove support for
old `CMAKE_TEST_BUILD_DEPENDS` variable. Update and improve
documentation.

This improves consistency between test and install preparation targets.
It also modifies the descriptions of preparation targets in the
documentation of generators which support them to be consistent.
(Previously, each generator described preparation targets in a manner
unique to each generator.)

Fixes: #28050
2026-10-14 16:10:45 -04:00

25 lines
806 B
CMake

cmake_minimum_required(VERSION 4.3)
project(TestDependencyAddTest C)
enable_testing()
add_executable(fake_discovery fake_discovery.c)
# Ensure the timestamp check uses the artifact path, not the target name.
set_target_properties(fake_discovery PROPERTIES OUTPUT_NAME renamed_discovery)
add_test(NAME ADD_TEST.command_genex
COMMAND $<TARGET_FILE:fake_discovery> fake_discovery case_foo)
set_tests_properties(ADD_TEST.command_genex PROPERTIES
LABELS label_one)
add_test(NAME ADD_TEST.command_target
COMMAND "$<1:fake_discovery>" case_bar)
set_tests_properties(ADD_TEST.command_target PROPERTIES
LABELS label_two)
add_test(NAME ADD_TEST.build_depends
COMMAND ${CMAKE_COMMAND} -E true
BUILD_DEPENDS fake_discovery)
set_tests_properties(ADD_TEST.build_depends PROPERTIES
LABELS label_three)