summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_compile_definitions/consumer.cpp8
-rw-r--r--Tests/CMakeCommands/target_include_directories/CMakeLists.txt6
-rw-r--r--Tests/CMakeCommands/target_link_libraries/CMakeLists.txt8
-rw-r--r--Tests/CTestUpdateGIT.cmake.in10
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt2
6 files changed, 14 insertions, 22 deletions
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
index 8a4437b..6d0e646 100644
--- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
@@ -18,7 +18,5 @@ add_executable(consumer
target_compile_definitions(consumer
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
- $<$<TARGET_DEFINED:notdefined>:SHOULD_NOT_BE_DEFINED>
- $<$<TARGET_DEFINED:target_compile_definitions>:SHOULD_BE_DEFINED>
-DDASH_D_DEFINE
)
diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp
index 1a46aa5..a391114 100644
--- a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp
+++ b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp
@@ -11,14 +11,6 @@
#error Expected MY_INTERFACE_DEFINE
#endif
-#ifdef SHOULD_NOT_BE_DEFINED
-#error Unexpected SHOULD_NOT_BE_DEFINED
-#endif
-
-#ifndef SHOULD_BE_DEFINED
-#error Expected SHOULD_BE_DEFINED
-#endif
-
#ifndef DASH_D_DEFINE
#error Expected DASH_D_DEFINE
#endif
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index c2da175..c03f0f8 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -30,12 +30,12 @@ target_include_directories(target_include_directories
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/poison"
)
target_include_directories(target_include_directories
- BEFORE PUBLIC "$<$<TARGET_DEFINED:target_include_directories>:${CMAKE_CURRENT_BINARY_DIR}/cure>"
+ BEFORE PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:target_include_directories,TYPE>,EXECUTABLE>:${CMAKE_CURRENT_BINARY_DIR}/cure>"
)
-# Has no effect because the target is not defined:
+# Has no effect because the target type is not SHARED_LIBRARY:
target_include_directories(target_include_directories
- BEFORE PUBLIC "$<$<TARGET_DEFINED:notdefined>:${CMAKE_CURRENT_BINARY_DIR}/poison>"
+ BEFORE PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:target_include_directories,TYPE>,SHARED_LIBRARY>:${CMAKE_CURRENT_BINARY_DIR}/poison>"
)
add_executable(consumer
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 19ee59f..b13c13d 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -103,7 +103,7 @@ target_compile_definitions(depG INTERFACE
)
add_executable(targetC targetC.cpp)
-# Creates a generator expression for include directories like
-# $<$<TARGET_DEFINED:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>>:\
-# $<TARGET_PROPERTY:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>,INTERFACE_INCLUDE_DIRECTORIES>>
-target_link_libraries(targetC $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>)
+# The TARGET_PROPERTY expression is duplicated below to test that there is no
+# shortcutting of the evaluation by returning an empty string.
+set(_exe_test $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
+target_link_libraries(targetC $<$<AND:${_exe_test},${_exe_test}>:depG>)
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 0c01291..f6939de 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -76,6 +76,8 @@ run_child(WORKING_DIRECTORY ${TOP}/module
# Import initial content into the repository.
message("Importing content...")
create_content(import)
+file(WRITE ${TOP}/import/HEAD "HEAD\n")
+file(WRITE ${TOP}/import/master "master\n")
# Import the content into the repository.
run_child(WORKING_DIRECTORY ${TOP}/import
@@ -157,19 +159,19 @@ update_content(user-source files_added files_removed dirs_added)
if(dirs_added)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} add ${dirs_added}
+ COMMAND ${GIT} add -- ${dirs_added}
)
endif()
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} add ${files_added}
+ COMMAND ${GIT} add -- ${files_added}
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} rm ${files_removed}
+ COMMAND ${GIT} rm -- ${files_removed}
)
run_child(WORKING_DIRECTORY ${TOP}/user-source/module
- COMMAND ${GIT} checkout master
+ COMMAND ${GIT} checkout master --
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index ae938cd..c00ef82 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -149,7 +149,7 @@ set_property(TARGET testLibRequired APPEND PROPERTY
$<BUILD_INTERFACE:$<TARGET_PROPERTY:testLibIncludeRequired5,INTERFACE_INCLUDE_DIRECTORIES>>
$<INSTALL_INTERFACE:$<TARGET_PROPERTY:testLibIncludeRequired6,INTERFACE_INCLUDE_DIRECTORIES>>
# Test that the below is non-fatal
- $<$<TARGET_DEFINED:not_a_target>:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>>
+ $<$<STREQUAL:one,two>:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>>
)
set_property(TARGET testLibRequired APPEND PROPERTY