mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 13:27:09 +00:00
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
25 lines
806 B
CMake
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)
|