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.
This commit is contained in:
parent
bf5fc1d582
commit
8707814e78
|
@ -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})
|
||||
|
|
|
@ -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\)
|
||||
|
|
|
@ -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\)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue