summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-30 14:32:51 -0400
committerBrad King <brad.king@kitware.com>2014-06-30 14:32:51 -0400
commit8707814e788e07f92c776a922af57f525e77452c (patch)
tree1d5988e81498b8970e07a7c46f6b32cc6de294e3 /Tests
parentbf5fc1d5829e7995c0941996b4a515cbd46d4e4e (diff)
downloadcmake-8707814e788e07f92c776a922af57f525e77452c.tar.gz
Tests: Refactor RunCMake.File_Generate to drop RunCMake_TEST_FILE
Drop use of RunCMake_TEST_FILE and pass the test file in through a definition in RunCMake_TEST_OPTIONS.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/File_Generate/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt2
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt2
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake4
4 files changed, 8 insertions, 5 deletions
diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt
index 12cd3c7757..bc0cf5d164 100644
--- a/Tests/RunCMake/File_Generate/CMakeLists.txt
+++ b/Tests/RunCMake/File_Generate/CMakeLists.txt
@@ -1,3 +1,6 @@
cmake_minimum_required(VERSION 2.8.4)
project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
+if(NOT TEST_FILE)
+ set(TEST_FILE ${RunCMake_TEST}.cmake)
+endif()
+include(${TEST_FILE})
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt
index 9fe39cca6f..e823b25dd8 100644
--- a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt
+++ b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at EmptyCondition1.cmake:2 \(file\):
file Incorrect arguments to GENERATE subcommand.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt
index 73d5f2504d..b042946f3f 100644
--- a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt
+++ b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at EmptyCondition2.cmake:2 \(file\):
file CONDITION of sub-command GENERATE must not be empty if specified.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
index f23fa1983d..f74d17e830 100644
--- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -12,10 +12,10 @@ run_cmake(DebugEvaluate)
set(timeformat "%Y%j%H%M%S")
file(REMOVE "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt")
-set(RunCMake_TEST_FILE "WriteIfDifferent")
+set(RunCMake_TEST_OPTIONS "-DTEST_FILE=WriteIfDifferent.cmake")
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/WriteIfDifferent-build")
run_cmake(WriteIfDifferent-prepare)
-unset(RunCMake_TEST_FILE)
+unset(RunCMake_TEST_OPTIONS)
unset(RunCMake_TEST_BINARY_DIR)
file(TIMESTAMP "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt" timestamp ${timeformat})
if(NOT timestamp)