summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-06-28 15:30:19 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-26 19:09:49 (GMT)
commite1d49847069ff6319bb259bf4eb628111d2a1340 (patch)
treeac8233740c4c6242087dbaed0ff125a83557b62f /Tests/RunCMake/try_compile
parent6a858138068f3b7ce9afc4628ebdd7fb63de6936 (diff)
downloadCMake-e1d49847069ff6319bb259bf4eb628111d2a1340.zip
CMake-e1d49847069ff6319bb259bf4eb628111d2a1340.tar.gz
CMake-e1d49847069ff6319bb259bf4eb628111d2a1340.tar.bz2
Tests: Add RunCMake.try_compile case covering empty value arguments
Diffstat (limited to 'Tests/RunCMake/try_compile')
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt9
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs.cmake4
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake1
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs-result.txt b/Tests/RunCMake/try_compile/EmptyValueArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/EmptyValueArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt
new file mode 100644
index 0000000..b1344bd
--- /dev/null
+++ b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\):
+ COPY_FILE must be followed by a file path
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\):
+ COPY_FILE_ERROR must be followed by a variable name
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake
new file mode 100644
index 0000000..f564abc
--- /dev/null
+++ b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake
@@ -0,0 +1,4 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ COPY_FILE "")
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ COPY_FILE "x" COPY_FILE_ERROR "")
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 1467157..d377cce 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -17,6 +17,7 @@ run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)
run_cmake(BinDirEmpty)
run_cmake(BinDirRelative)
+run_cmake(EmptyValueArgs)
run_cmake(EmptyListArgs)
run_cmake(EnvConfig)