summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-23 12:52:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-23 12:52:13 (GMT)
commit98aef0929f4c5ce7bbf7ce9c2dfc5cad382f5a96 (patch)
treebfb6ee80bbd3e3e4ee81cd3c0aca30dca0cd747c /Tests/RunCMake/try_compile
parent14a0794b66d64e856d8b41afec086f1fb94f503d (diff)
parent611d80179006ba6670273fcfcad46b0bb64a36c2 (diff)
downloadCMake-98aef0929f4c5ce7bbf7ce9c2dfc5cad382f5a96.zip
CMake-98aef0929f4c5ce7bbf7ce9c2dfc5cad382f5a96.tar.gz
CMake-98aef0929f4c5ce7bbf7ce9c2dfc5cad382f5a96.tar.bz2
Merge topic 'try_compile-source-from'
611d801790 try_compile: Add SOURCE_FROM_FILE a04eaf6742 Tests: Clean up and simplify TryCompile tests cb14ae2b87 try_compile: Add SOURCE_FROM_{ARG,VAR} Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7700
Diffstat (limited to 'Tests/RunCMake/try_compile')
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake1
13 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index bb11a57..d63624c 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -20,6 +20,11 @@ set(RunCMake_TEST_OPTIONS -Dtry_compile_DEFS=new_signature.cmake)
include(${RunCMake_SOURCE_DIR}/old_and_new_signature_tests.cmake)
unset(RunCMake_TEST_OPTIONS)
+run_cmake(SourceFromOneArg)
+run_cmake(SourceFromThreeArgs)
+run_cmake(SourceFromBadName)
+run_cmake(SourceFromBadFile)
+
run_cmake(ProjectCopyFile)
run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)
diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt b/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt b/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt
new file mode 100644
index 0000000..53a6d8d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourceFromBadFile.cmake:[0-9]+ \(try_compile\):
+ SOURCE_FROM_FILE failed to copy "bad#source.c": No such file or directory
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile.cmake b/Tests/RunCMake/try_compile/SourceFromBadFile.cmake
new file mode 100644
index 0000000..0a37f11
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadFile.cmake
@@ -0,0 +1 @@
+try_compile(RESULT SOURCE_FROM_FILE bad.c "bad#source.c")
diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-result.txt b/Tests/RunCMake/try_compile/SourceFromBadName-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadName-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt b/Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt
new file mode 100644
index 0000000..ef6847c
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourceFromBadName.cmake:[0-9]+ \(try_compile\):
+ SOURCES_FROM_ARG given invalid filename "bad/name.c"
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/SourceFromBadName.cmake b/Tests/RunCMake/try_compile/SourceFromBadName.cmake
new file mode 100644
index 0000000..e53a73f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromBadName.cmake
@@ -0,0 +1 @@
+try_compile(RESULT SOURCE_FROM_ARG bad/name.c "int main();")
diff --git a/Tests/RunCMake/try_compile/SourceFromOneArg-result.txt b/Tests/RunCMake/try_compile/SourceFromOneArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromOneArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt b/Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt
new file mode 100644
index 0000000..bebe8bb
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourceFromOneArg.cmake:[0-9]+ \(try_compile\):
+ SOURCE_FROM_ARG requires exactly two arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/SourceFromOneArg.cmake b/Tests/RunCMake/try_compile/SourceFromOneArg.cmake
new file mode 100644
index 0000000..39ca11e
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromOneArg.cmake
@@ -0,0 +1 @@
+try_compile(RESULT SOURCE_FROM_ARG test.c)
diff --git a/Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt b/Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt b/Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt
new file mode 100644
index 0000000..2cf201d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourceFromThreeArgs.cmake:[0-9]+ \(try_compile\):
+ SOURCE_FROM_ARG requires exactly two arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake b/Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake
new file mode 100644
index 0000000..af6340d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake
@@ -0,0 +1 @@
+try_compile(RESULT SOURCE_FROM_ARG test.c "int" "main();")