diff options
author | Brad King <brad.king@kitware.com> | 2014-06-30 18:32:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-30 18:32:51 (GMT) |
commit | 8707814e788e07f92c776a922af57f525e77452c (patch) | |
tree | 1d5988e81498b8970e07a7c46f6b32cc6de294e3 /Tests | |
parent | bf5fc1d5829e7995c0941996b4a515cbd46d4e4e (diff) | |
download | CMake-8707814e788e07f92c776a922af57f525e77452c.zip CMake-8707814e788e07f92c776a922af57f525e77452c.tar.gz CMake-8707814e788e07f92c776a922af57f525e77452c.tar.bz2 |
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')
4 files changed, 8 insertions, 5 deletions
diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt index 12cd3c7..bc0cf5d 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 9fe39cc..e823b25 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 73d5f25..b042946 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 f23fa19..f74d17e 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) |