Set so that the pass tests are all tests that do not end in .fail.cpp

This commit is contained in:
Darrell Wright 2017-11-27 00:11:03 -05:00 committed by Howard Hinnant
parent 53629fa30c
commit 2d2b65906a

View File

@ -70,15 +70,16 @@ function( add_pass_tests TEST_GLOB TEST_PREFIX )
foreach( TEST_FILE ${FILENAMES} )
get_filename_component( TEST_NAME ${TEST_FILE} NAME_WE )
get_filename_component( TEST_EXT ${TEST_FILE} EXT )
set( PREFIX "${TEST_PREFIX}_${TEST_NAME}_pass" )
set( BIN_NAME ${PREFIX}_bin )
set( TST_NAME ${PREFIX}_test )
add_executable( ${BIN_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
set_property(TARGET ${BIN_NAME} PROPERTY CXX_STANDARD 14)
add_test( ${TST_NAME} ${BIN_NAME} )
target_link_libraries( ${BIN_NAME} tz )
add_dependencies( testit ${BIN_NAME} )
if( NOT ${TEST_EXT} STREQUAL ".fail.cpp" )
set( PREFIX "${TEST_PREFIX}_${TEST_NAME}_pass" )
set( BIN_NAME ${PREFIX}_bin )
set( TST_NAME ${PREFIX}_test )
add_executable( ${BIN_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
set_property(TARGET ${BIN_NAME} PROPERTY CXX_STANDARD 14)
add_test( ${TST_NAME} ${BIN_NAME} )
target_link_libraries( ${BIN_NAME} tz )
add_dependencies( testit ${BIN_NAME} )
endif( )
endforeach( )
endfunction( )
@ -112,7 +113,7 @@ file( GLOB children RELATIVE "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}" "${PROJECT_S
foreach( child ${children} )
if( IS_DIRECTORY "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/${child}" )
set( CUR_FOLDER "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/${child}" )
add_pass_tests( "${CUR_FOLDER}/*.pass.cpp" ${child} )
add_pass_tests( "${CUR_FOLDER}/*.cpp" ${child} )
if( NOT WIN32 )
add_fail_tests( "${CUR_FOLDER}/*.fail.cpp" ${child} )
endif( )