mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 22:10:32 +00:00
Tests: Delay RunCMake.ExternalProject case checks
Use RunCMake "-check.cmake" scripts to check the generated initial cache file content so that the full generation process is completed.
This commit is contained in:
parent
1f1b62b0e2
commit
2842927019
17
Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
Normal file
17
Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
set(RunCMake_TEST_FAILED "Initial cache not created")
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
set(RunCMake_TEST_FAILED "Cannot find FOO argument in cache")
|
||||
return()
|
||||
endif()
|
||||
if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
set(RunCMake_TEST_FAILED "Expected forced FOO argument")
|
||||
return()
|
||||
endif()
|
@ -1,21 +1,5 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(_tmp_dir "${CMAKE_CURRENT_BINARY_DIR}/tmp")
|
||||
set(_cache_file "${_tmp_dir}/FOO-cache.cmake")
|
||||
|
||||
ExternalProject_Add(FOO TMP_DIR "${_tmp_dir}"
|
||||
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
|
||||
DOWNLOAD_COMMAND ""
|
||||
CMAKE_CACHE_ARGS "-DFOO:STRING=BAR")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
message(FATAL_ERROR "Initial cache not created")
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
message(FATAL_ERROR "Cannot find FOO argument in cache")
|
||||
endif()
|
||||
if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
message(FATAL_ERROR "Expected forced FOO argument")
|
||||
endif()
|
||||
|
@ -0,0 +1,17 @@
|
||||
set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
set(RunCMake_TEST_FAILED "Initial cache not created")
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
set(RunCMake_TEST_FAILED "Cannot find FOO argument in cache")
|
||||
return()
|
||||
endif()
|
||||
if("${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
set(RunCMake_TEST_FAILED "Expected not forced FOO argument")
|
||||
return()
|
||||
endif()
|
@ -1,21 +1,5 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(_tmp_dir "${CMAKE_CURRENT_BINARY_DIR}/tmp")
|
||||
set(_cache_file "${_tmp_dir}/FOO-cache.cmake")
|
||||
|
||||
ExternalProject_Add(FOO TMP_DIR "${_tmp_dir}"
|
||||
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
|
||||
DOWNLOAD_COMMAND ""
|
||||
CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=BAR")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
message(FATAL_ERROR "Initial cache not created")
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
message(FATAL_ERROR "Cannot find FOO argument in cache")
|
||||
endif()
|
||||
if("${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
message(FATAL_ERROR "Expected not forced FOO argument")
|
||||
endif()
|
||||
|
26
Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
Normal file
26
Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
Normal file
@ -0,0 +1,26 @@
|
||||
set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
set(RunCMake_TEST_FAILED "Initial cache not created")
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
set(RunCMake_TEST_FAILED "Cannot find FOO argument in cache")
|
||||
return()
|
||||
endif()
|
||||
if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
set(RunCMake_TEST_FAILED "Expected forced FOO argument")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(BAR \"BAZ\".+\\)") # \(\)
|
||||
set(RunCMake_TEST_FAILED "Cannot find BAR argument in cache")
|
||||
return()
|
||||
endif()
|
||||
if("${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
set(RunCMake_TEST_FAILED "Expected not forced BAR argument")
|
||||
return()
|
||||
endif()
|
@ -1,29 +1,6 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(_tmp_dir "${CMAKE_CURRENT_BINARY_DIR}/tmp")
|
||||
set(_cache_file "${_tmp_dir}/FOO-cache.cmake")
|
||||
|
||||
ExternalProject_Add(FOO TMP_DIR "${_tmp_dir}"
|
||||
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
|
||||
DOWNLOAD_COMMAND ""
|
||||
CMAKE_CACHE_ARGS "-DFOO:STRING=BAR"
|
||||
CMAKE_CACHE_DEFAULT_ARGS "-DBAR:STRING=BAZ")
|
||||
|
||||
if(NOT EXISTS "${_cache_file}")
|
||||
message(FATAL_ERROR "Initial cache not created")
|
||||
endif()
|
||||
|
||||
file(READ "${_cache_file}" _cache)
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(FOO \"BAR\".+\\)") # \(\)
|
||||
message(FATAL_ERROR "Cannot find FOO argument in cache")
|
||||
endif()
|
||||
if(NOT "${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
message(FATAL_ERROR "Expected forced FOO argument")
|
||||
endif()
|
||||
|
||||
if(NOT "${_cache}" MATCHES "set\\(BAR \"BAZ\".+\\)") # \(\)
|
||||
message(FATAL_ERROR "Cannot find BAR argument in cache")
|
||||
endif()
|
||||
if("${CMAKE_MATCH_0}" MATCHES FORCE)
|
||||
message(FATAL_ERROR "Expected not forced BAR argument")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user