FPHSA: Convert FOUND_VAR failure test to RunCMake
Move the Tests/FPHSA_InvalidFOUND_VAR test case over to a new RunCMake.FPHSA test with a BadFoundVar case. The RunCMake tests are built to cover failure cases easily and robustly.
This commit is contained in:
parent
c1f5780e2d
commit
f17711c546
|
@ -147,9 +147,6 @@ if(BUILD_TESTING)
|
|||
# add a bunch of standard build-and-test style tests
|
||||
ADD_TEST_MACRO(CommandLineTest CommandLineTest)
|
||||
ADD_TEST_MACRO(FindPackageTest FindPackageTest)
|
||||
ADD_TEST_MACRO(FPHSA_InvalidFOUND_VAR FPHSA_InvalidFOUND_VAR)
|
||||
set_tests_properties(FPHSA_InvalidFOUND_VAR PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "The argument for FOUND_VAR is .badfoundvar_FOUND., but only")
|
||||
ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll)
|
||||
ADD_TEST_MACRO(StringFileTest StringFileTest)
|
||||
ADD_TEST_MACRO(TryCompile TryCompile)
|
||||
|
|
|
@ -56,6 +56,7 @@ if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
|
|||
add_RunCMake_test(CompilerChange)
|
||||
endif()
|
||||
add_RunCMake_test(ExternalData)
|
||||
add_RunCMake_test(FPHSA)
|
||||
add_RunCMake_test(GeneratorExpression)
|
||||
add_RunCMake_test(GeneratorToolset)
|
||||
add_RunCMake_test(TargetPropertyGeneratorExpressions)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,7 @@
|
|||
CMake Error at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
|
||||
The argument for FOUND_VAR is "badfoundvar_FOUND", but only
|
||||
"BadFoundVar_FOUND" and "BADFOUNDVAR_FOUND" are valid names.
|
||||
Call Stack \(most recent call first\):
|
||||
FindBadFoundVar.cmake:5 \(find_package_handle_standard_args\)
|
||||
BadFoundVar.cmake:3 \(find_package\)
|
||||
CMakeLists.txt:3 \(include\)
|
|
@ -1,5 +1,3 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
find_package(BadFoundVar REQUIRED)
|
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1,3 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(BadFoundVar)
|
Loading…
Reference in New Issue