Skip to content

Commit

Permalink
GHI #15 Rename patomic_test options and make all caps
Browse files Browse the repository at this point in the history
- `patomic_test_CREATE_TEST_TARGETS_MATCHING` -> `PATOMIC_CREATE_TEST_TARGETS_MATCHING`
- `patomic_test_SET_CTEST_PATH_ENV_WINDOWS`   -> `PATOMIC_WINDOWS_SET_CTEST_PATH_ENV`
- `patomic_test_CREATE_WINDOWS_PATH_FILE`     -> `PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE`

Change the `patomic_test` prefix to just `PATOMIC` since they're all really options to do with `patomic`, and the `test` part is obvious from the remaining option name.

Signed-off-by: doodspav <[email protected]>
  • Loading branch information
doodspav committed Mar 25, 2023
1 parent a3321ea commit 2af3f04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions test/cmake/CreateTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ function(create_test)
set(target_deps patomic::patomic GTest::gtest_main ${ARG_LINK})
set(output_name ${name})

if (NOT "${target}" MATCHES ${patomic_test_CREATE_TEST_TARGETS_MATCHING})
message(DEBUG "Skipping creation of test target ${target} (matches ${patomic_test_CREATE_TEST_TARGETS_MATCHING})")
if (NOT "${target}" MATCHES ${PATOMIC_CREATE_TEST_TARGETS_MATCHING})
message(DEBUG "Skipping creation of test target ${target} (matches ${PATOMIC_CREATE_TEST_TARGETS_MATCHING})")
return()
endif()

Expand Down Expand Up @@ -119,7 +119,7 @@ function(create_test)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")

# check we actually care about Windows PATH stuff
if (NOT patomic_test_SET_CTEST_PATH_ENV_WINDOWS AND NOT patomic_test_CREATE_WINDOWS_PATH_FILE)
if (NOT PATOMIC_WINDOWS_SET_CTEST_PATH_ENV AND NOT PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE)
return()
endif()

Expand All @@ -130,7 +130,7 @@ function(create_test)
)

# set environment variable for the each test so that CTest works automatically
if (deps_path AND patomic_test_SET_CTEST_PATH_ENV_WINDOWS)
if (deps_path AND PATOMIC_WINDOWS_SET_CTEST_PATH_ENV)
foreach(test IN LISTS added_tests)
set_property(
TEST "${test}"
Expand All @@ -140,7 +140,7 @@ function(create_test)
endif()

# make dependencies accessible from parent target
if (patomic_test_CREATE_WINDOWS_PATH_FILE)
if (PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE)
set_property(
TARGET ${parent_target}
APPEND PROPERTY WIN_DEP_TARGETS ${target_deps}
Expand Down Expand Up @@ -194,7 +194,7 @@ function(create_test_win_deps_path_file ARG_KIND)

# check we actually want to generate file

if(NOT patomic_test_CREATE_WINDOWS_PATH_FILE)
if(NOT PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE)
return()
endif()

Expand Down
10 changes: 5 additions & 5 deletions test/cmake/OptionVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(
# Regex must be written according to CMake Regex Specification.
# By default all test targets are enabled.
set(
patomic_test_CREATE_TEST_TARGETS_MATCHING "^(.*)$"
PATOMIC_CREATE_TEST_TARGETS_MATCHING "^(.*)$"
CACHE STRING "Only test targets matching regex are created and registered with CTest"
)

Expand All @@ -33,11 +33,11 @@ set(
# than prepend to it.
# This gives users the option to disable this behaviour.
option(
patomic_test_SET_CTEST_PATH_ENV_WINDOWS
PATOMIC_WINDOWS_SET_CTEST_PATH_ENV
"Set PATH environment variable for tests when run CTest on Windows"
ON
)
mark_as_advanced(patomic_test_SET_CTEST_PATH_ENV_WINDOWS)
mark_as_advanced(PATOMIC_WINDOWS_SET_CTEST_PATH_ENV)


# ---- Windows Path File ----
Expand All @@ -50,8 +50,8 @@ mark_as_advanced(patomic_test_SET_CTEST_PATH_ENV_WINDOWS)
# Additionally disabled by default because it contains potentially private
# information about the target platform.
option(
patomic_test_CREATE_WINDOWS_PATH_FILE
PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE
"Create file with PATH environment variables for tests on Windows"
OFF
)
mark_as_advanced(patomic_test_CREATE_WINDOWS_PATH_FILE)
mark_as_advanced(PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE)

0 comments on commit 2af3f04

Please sign in to comment.