summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt1
-rw-r--r--Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake6
-rw-r--r--Tests/RunCMake/CMP0026/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake2
-rw-r--r--Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom1-result.txt1
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom1-stderr.txt9
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom1.cmake5
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom2-result.txt1
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom2-stderr.txt9
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom2.cmake5
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom3-result.txt1
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom3-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom3.cmake5
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom4-result.txt1
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom4-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalData/BadCustom4.cmake6
-rw-r--r--Tests/RunCMake/ExternalData/RunCMakeTest.cmake4
19 files changed, 84 insertions, 8 deletions
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
new file mode 100644
index 0000000..0996cb6
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
@@ -0,0 +1,12 @@
+CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_property\):
+ Policy CMP0026 is not set: Disallow use of the LOCATION target property.
+ Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The LOCATION property should not be read from target "bar". Use the target
+ name directly with add_custom_command, or use the generator expression
+ \$<TARGET_FILE>, as appropriate.
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
new file mode 100644
index 0000000..3d8eb73
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
@@ -0,0 +1,6 @@
+
+enable_language(CXX)
+
+add_library(foo OBJECT empty.cpp)
+add_executable(bar $<TARGET_OBJECTS:foo>)
+get_target_property(location bar LOCATION)
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index 7c2582f..fc58ea5 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -10,3 +10,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-NEW)
run_cmake(CMP0026-LOCATION-CONFIG-OLD)
run_cmake(CMP0026-LOCATION-CONFIG-WARN)
run_cmake(ObjlibNotDefined)
+run_cmake(LOCATION-and-TARGET_OBJECTS)
diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
index 4de8e88..b544b99 100644
--- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
+++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
@@ -11,7 +11,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_res
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp"
)
-add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp")
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp")
if (HAVE_FINAL)
target_compile_features(empty PRIVATE cxx_final)
endif()
diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
index 3b37091..1892a5c 100644
--- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
@@ -27,13 +27,8 @@ if (NOT CXX_FEATURES)
run_cmake(NoSupportedCxxFeatures)
run_cmake(NoSupportedCxxFeaturesGenex)
else()
- # compilers such as MSVC have no explicit flags to enable c++11 mode.
- # Instead they come with all c++11 features implicitly enabled.
- # So for those types of compilers this tests is not applicable.
- if(CMAKE_CXX11_STANDARD_COMPILE_OPTION)
- run_cmake(LinkImplementationFeatureCycle)
- run_cmake(LinkImplementationFeatureCycleSolved)
- endif()
+ run_cmake(LinkImplementationFeatureCycle)
+ run_cmake(LinkImplementationFeatureCycleSolved)
if (";${CXX_FEATURES};" MATCHES ";cxx_final;")
set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1")
diff --git a/Tests/RunCMake/ExternalData/BadCustom1-result.txt b/Tests/RunCMake/ExternalData/BadCustom1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt
new file mode 100644
index 0000000..5d2986d
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ Bad ExternalDataCustomScript key '0BadKey' in URL template:
+
+ ExternalDataCustomScript://0BadKey/%\(algo\)/%\(hash\)
+
+ The key must be a valid C identifier.
+Call Stack \(most recent call first\):
+ BadCustom1.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalData/BadCustom1.cmake b/Tests/RunCMake/ExternalData/BadCustom1.cmake
new file mode 100644
index 0000000..ec94fc1
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom1.cmake
@@ -0,0 +1,5 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "ExternalDataCustomScript://0BadKey/%(algo)/%(hash)"
+ )
+ExternalData_Add_Target(Data)
diff --git a/Tests/RunCMake/ExternalData/BadCustom2-result.txt b/Tests/RunCMake/ExternalData/BadCustom2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt
new file mode 100644
index 0000000..4d59ca9
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ Bad ExternalDataCustomScript key '' in URL template:
+
+ ExternalDataCustomScript:///%\(algo\)/%\(hash\)
+
+ The key must be a valid C identifier.
+Call Stack \(most recent call first\):
+ BadCustom2.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalData/BadCustom2.cmake b/Tests/RunCMake/ExternalData/BadCustom2.cmake
new file mode 100644
index 0000000..1ed7646
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom2.cmake
@@ -0,0 +1,5 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "ExternalDataCustomScript:///%(algo)/%(hash)"
+ )
+ExternalData_Add_Target(Data)
diff --git a/Tests/RunCMake/ExternalData/BadCustom3-result.txt b/Tests/RunCMake/ExternalData/BadCustom3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt
new file mode 100644
index 0000000..460814b
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ No ExternalData_CUSTOM_SCRIPT_MissingKey is set for URL template:
+
+ ExternalDataCustomScript://MissingKey/%\(algo\)/%\(hash\)
+Call Stack \(most recent call first\):
+ BadCustom3.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalData/BadCustom3.cmake b/Tests/RunCMake/ExternalData/BadCustom3.cmake
new file mode 100644
index 0000000..b4f2fb8
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom3.cmake
@@ -0,0 +1,5 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "ExternalDataCustomScript://MissingKey/%(algo)/%(hash)"
+ )
+ExternalData_Add_Target(Data)
diff --git a/Tests/RunCMake/ExternalData/BadCustom4-result.txt b/Tests/RunCMake/ExternalData/BadCustom4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt
new file mode 100644
index 0000000..b83bcee
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ No ExternalData_CUSTOM_SCRIPT_RelPathKey is not set to a full path:
+
+ RelPathScript.cmake
+Call Stack \(most recent call first\):
+ BadCustom4.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalData/BadCustom4.cmake b/Tests/RunCMake/ExternalData/BadCustom4.cmake
new file mode 100644
index 0000000..0cc5521
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadCustom4.cmake
@@ -0,0 +1,6 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "ExternalDataCustomScript://RelPathKey/%(algo)/%(hash)"
+ )
+set(ExternalData_CUSTOM_SCRIPT_RelPathKey "RelPathScript.cmake")
+ExternalData_Add_Target(Data)
diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
index 04e3d59..7afd289 100644
--- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
@@ -1,5 +1,9 @@
include(RunCMake)
+run_cmake(BadCustom1)
+run_cmake(BadCustom2)
+run_cmake(BadCustom3)
+run_cmake(BadCustom4)
run_cmake(BadHashAlgo1)
run_cmake(BadOption1)
run_cmake(BadOption2)