summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-14 13:51:48 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-14 14:07:37 (GMT)
commitd430cb7c36e7739a70da7897465badba62be7989 (patch)
treeb95c84e0d60178ebe4025fc11c5adbece90897c3 /Tests/RunCMake
parent332ee3e305f017a2991b2ae348644141d1539f61 (diff)
downloadCMake-d430cb7c36e7739a70da7897465badba62be7989.zip
CMake-d430cb7c36e7739a70da7897465badba62be7989.tar.gz
CMake-d430cb7c36e7739a70da7897465badba62be7989.tar.bz2
Tests: Fix failures when running under the default install prefix (#15566)
Fix test cases whose behavior differs when their source or build tree is under CMAKE_INSTALL_PREFIX by setting an install prefix under the build tree. Otherwise they may fail when run under the default install prefix (e.g. /usr/local).
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0041/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/IfacePaths/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake3
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
index a5e2114..e7f27a1 100644
--- a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
include(RunCMake)
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
run_cmake(CMP0041-OLD)
run_cmake(CMP0041-NEW)
run_cmake(CMP0041-WARN)
diff --git a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
index 489e3df..066c83e 100644
--- a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
+++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
@@ -6,6 +6,9 @@ macro(run_cmake test)
_run_cmake(${test})
endmacro()
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
run_cmake(RelativePathInInterface)
run_cmake(RelativePathInGenex)
run_cmake(export-NOWARN)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index 3f624f8..54d5e97 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
include(RunCMake)
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
run_cmake(NotFoundContent)
run_cmake(DebugIncludes)
run_cmake(TID-bad-target)