Tests: Port GenerateExportHeader test to RunCMake infrastructure

This will allow build failure cases to be added later.
This commit is contained in:
Brad King 2016-09-01 15:22:05 -04:00
parent 4feba34d02
commit fc3dab0ea9
41 changed files with 27 additions and 2 deletions

View File

@ -485,7 +485,6 @@ if(BUILD_TESTING)
) )
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData")
ADD_TEST_MACRO(Module.GenerateExportHeader GenerateExportHeader)
ADD_TEST_MACRO(Module.FindDependency FindDependency) ADD_TEST_MACRO(Module.FindDependency FindDependency)
ADD_TEST_MACRO(Module.WriteCompilerDetectionHeader WriteCompilerDetectionHeader) ADD_TEST_MACRO(Module.WriteCompilerDetectionHeader WriteCompilerDetectionHeader)

View File

@ -141,6 +141,9 @@ add_RunCMake_test(DisallowedCommands)
add_RunCMake_test(ExternalData) add_RunCMake_test(ExternalData)
add_RunCMake_test(FeatureSummary) add_RunCMake_test(FeatureSummary)
add_RunCMake_test(FPHSA) add_RunCMake_test(FPHSA)
if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom")
add_RunCMake_test(GenerateExportHeader)
endif()
add_RunCMake_test(GeneratorExpression) add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(GeneratorPlatform) add_RunCMake_test(GeneratorPlatform)
add_RunCMake_test(GeneratorToolset) add_RunCMake_test(GeneratorToolset)

View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 2.8.5)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@ -0,0 +1 @@
.*

View File

@ -0,0 +1 @@
.*

View File

@ -78,6 +78,7 @@ add_subdirectory(lib_shared_and_static)
add_compiler_export_flags() add_compiler_export_flags()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR})
message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED}) message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED})
message("#### COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY}) message("#### COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY})

View File

@ -0,0 +1,17 @@
include(RunCMake)
function(run_GEH)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GEH-build)
set(RunCMake_TEST_NO_CLEAN 1)
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(GEH)
run_cmake_command(GEH-build ${CMAKE_COMMAND} --build . --config Debug)
run_cmake_command(GEH-run ${RunCMake_TEST_BINARY_DIR}/GenerateExportHeader)
endfunction()
run_GEH()

View File

@ -126,7 +126,7 @@ $git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Utilities/(KW|cm).*/' |
# Exclude reference content. # Exclude reference content.
egrep -z -v '^Tests/Module/GenerateExportHeader/reference/' | egrep -z -v '^Tests/RunCMake/GenerateExportHeader/reference/' |
# Exclude manually-formatted sources (e.g. with long lines). # Exclude manually-formatted sources (e.g. with long lines).
egrep -z -v '^Tests/PositionIndependentTargets/pic_test.h' | egrep -z -v '^Tests/PositionIndependentTargets/pic_test.h' |