From fca157b0b2d646ce187d17e4396d04b95b619756 Mon Sep 17 00:00:00 2001 From: Kyle Knoepfel Date: Fri, 10 Nov 2023 09:19:06 -0600 Subject: [PATCH] Enable prepending to path-like environment variables (#14) * Enable prepending to path-like environment variables. * Suggested changes for `cet_test_prepend_env()` and related * Suggested changes per @knoepfel * Documentation tweaks * `cet_test_prepend_env()` forwards to new function `cet_test_env_mod()` * Rename function for `cet_test_env_*` consistency --------- Co-authored-by: Chris Green --- CMakeLists.txt | 2 +- Modules/CetTest.cmake | 367 +++++------------- .../manual/cetmodules-commands.7.rst | 2 + doc/reference/variable/CET_TEST_ENV.rst | 10 + .../variable/CET_TEST_ENV_MODIFICATION.rst | 10 + 5 files changed, 113 insertions(+), 278 deletions(-) create mode 100644 doc/reference/variable/CET_TEST_ENV.rst create mode 100644 doc/reference/variable/CET_TEST_ENV_MODIFICATION.rst diff --git a/CMakeLists.txt b/CMakeLists.txt index fc7ec6b7..5f7da033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ # * Awareness of multi-project builds. # ######################################################################## -set(CETMODULES_MIN_CMAKE_VERSION 3.21) # Used in config/cetmodules-cmake-version-check.cmake +set(CETMODULES_MIN_CMAKE_VERSION 3.22) # Used in config/cetmodules-cmake-version-check.cmake # Required to keep CMake happy. cmake_minimum_required(VERSION ${CETMODULES_MIN_CMAKE_VERSION}...3.27 diff --git a/Modules/CetTest.cmake b/Modules/CetTest.cmake index 516bcaa9..c100bb91 100644 --- a/Modules/CetTest.cmake +++ b/Modules/CetTest.cmake @@ -8,280 +8,6 @@ CetTest #]================================================================] -######################################################################## -# cet_test: specify tests in a concise and transparent way (see also -# cet_test_env() and cet_test_assertion(), below). -# -# Usage: cet_test(target [] []) -# -#################################### -# Target category options (specify at most one): -# -# COMPILE_ONLY -# -# The test is the act of attempting to build the given sources, not -# the execution of the result of the build. Use in conjunction with -# TEST_PROPERTIES WILL_FAIL and/or PASS/FAIL_REGULAR_EXPRESSION. -# -# HANDBUILT -# -# Do not build the target -- it will be provided. -# -# PREBUILT -# -# Do not build the target -- copy in from the source dir (ideal for -# e.g. scripts). -# -# USE_CATCH_MAIN -# USE_CATCH2_MAIN -# -# This test will use the Catch test framework -# (https://github.com/philsquared/Catch). The specified target will be -# built from a precompiled main program to run tests described in the -# files specified by SOURCES. -# -# N.B.: if you wish to use the ParseAndAddCatchTests() facility -# contributed to the Catch system, you should specify NO_AUTO to avoid -# generating a, "standard" test. Note also that you may have your own -# test executables using Catch without using USE_CATCH2_MAIN. However, -# be aware that the compilation of a Catch main is quite expensive, -# and any tests that *do* use this option will all share the same -# compiled main. -# -# Note also that client packages are responsible for making sure Catch -# is available, such as with: -# -# catch -nq- only_for_build -# -# in product_deps. -# -#################################### -# Other options: -# -# CONFIGURATIONS + -# -# Configurations (Debug, etc, etc) under which the test shall be -# executed. -# -# DATAFILES + -# -# Input and/or references files to be copied to the test area in the -# build tree for use by the test. If there is no path, or a relative -# path, the file is assumed to be in or under -# ${CMAKE_CURRENT_SOURCE_DIR}. -# -# DEPENDENCIES + -# -# List of top-level dependencies to consider for a PREBUILT -# target. Top-level implies a target (not file) created with -# ADD_EXECUTABLE, ADD_LIBRARY or ADD_CUSTOM_TARGET. -# -# DIRTY_WORKDIR -# -# If set, the working directory will not be cleared prior to execution -# of the test. -# -# INSTALL_BIN -# -# Install this test's script / exec in the product's binary directory -# (ignored for HANDBUILT). -# -# INSTALL_EXAMPLE -# -# Install this test and all its data files into the examples area of -# the product. -# -# INSTALL_SOURCE -# -# Install this test's source in the source area of the product. -# -# LIBRARIES + -# -# Extra libraries with which to link this target. -# -# NO_AUTO -# -# Do not add the target to the auto test list. N.B. all options -# related to the declaration of tests and setting of properties -# thereof will be ignored. -# -# OPTIONAL_GROUPS + -# -# Assign this test to one or more named optional groups (a.k.a CMake -# test labels). If ctest is executed specifying labels, then matching -# tests will be executed. -# -# PARG_