summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-08-06 09:38:17 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2015-08-06 09:38:17 -0400
commitd356bced9b362be1396c91854e0684da6ec6f507 (patch)
tree67503bc7974cfbda2db06d427cc0bac11e3693dc /Tests
parent42526efec45993466cbc605eb2cee70194eed4a6 (diff)
parentc4d2f64f3c9dea3a5fcd8af5bb389db00ccd64df (diff)
downloadcmake-d356bced9b362be1396c91854e0684da6ec6f507.tar.gz
Merge topic 'fix-missing-subdir-error'
c4d2f64f add_subdirectory: Fix error message on missing CMakeLists.txt (#15680)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt5
-rw-r--r--Tests/RunCMake/add_subdirectory/DoesNotExist.cmake1
-rw-r--r--Tests/RunCMake/add_subdirectory/Missing-result.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/Missing-stderr.txt8
-rw-r--r--Tests/RunCMake/add_subdirectory/Missing.cmake1
-rw-r--r--Tests/RunCMake/add_subdirectory/Missing/Missing.txt0
-rw-r--r--Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake4
10 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 20d47b23cd..78df6032f6 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -162,6 +162,7 @@ add_RunCMake_test(Syntax)
add_RunCMake_test(add_custom_command)
add_RunCMake_test(add_custom_target)
add_RunCMake_test(add_dependencies)
+add_RunCMake_test(add_subdirectory)
add_RunCMake_test(build_command)
add_RunCMake_test(execute_process)
add_RunCMake_test(export)
diff --git a/Tests/RunCMake/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMakeLists.txt
new file mode 100644
index 0000000000..18dfd2686f
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.2)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt
new file mode 100644
index 0000000000..369a956e61
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at DoesNotExist.cmake:1 \(add_subdirectory\):
+ add_subdirectory given source "DoesNotExist" which is not an existing
+ directory.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake b/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake
new file mode 100644
index 0000000000..fe2945ce7e
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake
@@ -0,0 +1 @@
+add_subdirectory(DoesNotExist)
diff --git a/Tests/RunCMake/add_subdirectory/Missing-result.txt b/Tests/RunCMake/add_subdirectory/Missing-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Missing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt
new file mode 100644
index 0000000000..aba06755a1
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at Missing.cmake:1 \(add_subdirectory\):
+ The source directory
+
+ .*/Tests/RunCMake/add_subdirectory/Missing
+
+ does not contain a CMakeLists.txt file.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/add_subdirectory/Missing.cmake b/Tests/RunCMake/add_subdirectory/Missing.cmake
new file mode 100644
index 0000000000..0e6892763d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Missing.cmake
@@ -0,0 +1 @@
+add_subdirectory(Missing)
diff --git a/Tests/RunCMake/add_subdirectory/Missing/Missing.txt b/Tests/RunCMake/add_subdirectory/Missing/Missing.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Missing/Missing.txt
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
new file mode 100644
index 0000000000..a3ddec8ecf
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(DoesNotExist)
+run_cmake(Missing)