mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-26 07:53:16 +08:00
No longer hardwiring subfolders of test
Hid build errors on should fail tests
This commit is contained in:
parent
748a1fd5a9
commit
53629fa30c
@ -64,7 +64,7 @@ add_custom_target( testit COMMAND ${CMAKE_CTEST_COMMAND} )
|
|||||||
|
|
||||||
add_dependencies( testit tz )
|
add_dependencies( testit tz )
|
||||||
function( add_pass_tests TEST_GLOB TEST_PREFIX )
|
function( add_pass_tests TEST_GLOB TEST_PREFIX )
|
||||||
file( GLOB FILENAMES ${TEST_GLOB} )
|
file( GLOB_RECURSE FILENAMES ${TEST_GLOB} )
|
||||||
include_directories( "${HEADER_FOLDER}/date" )
|
include_directories( "${HEADER_FOLDER}/date" )
|
||||||
|
|
||||||
foreach( TEST_FILE ${FILENAMES} )
|
foreach( TEST_FILE ${FILENAMES} )
|
||||||
@ -83,7 +83,7 @@ function( add_pass_tests TEST_GLOB TEST_PREFIX )
|
|||||||
endfunction( )
|
endfunction( )
|
||||||
|
|
||||||
function( add_fail_tests TEST_GLOB TEST_PREFIX )
|
function( add_fail_tests TEST_GLOB TEST_PREFIX )
|
||||||
file( GLOB FILENAMES ${TEST_GLOB} )
|
file( GLOB_RECURSE FILENAMES ${TEST_GLOB} )
|
||||||
|
|
||||||
foreach( TEST_FILE ${FILENAMES} )
|
foreach( TEST_FILE ${FILENAMES} )
|
||||||
get_filename_component( TEST_NAME ${TEST_FILE} NAME_WE )
|
get_filename_component( TEST_NAME ${TEST_FILE} NAME_WE )
|
||||||
@ -108,13 +108,14 @@ function( add_fail_tests TEST_GLOB TEST_PREFIX )
|
|||||||
endforeach( )
|
endforeach( )
|
||||||
endfunction( )
|
endfunction( )
|
||||||
|
|
||||||
add_pass_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/date_test/*.pass.cpp" "date_test" )
|
file( GLOB children RELATIVE "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}" "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/*" )
|
||||||
add_pass_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/iso_week_test/*.pass.cpp" "iso_week_test" )
|
foreach( child ${children} )
|
||||||
add_pass_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/tz_test/*.pass.cpp" "tz_test" )
|
if( IS_DIRECTORY "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/${child}" )
|
||||||
|
set( CUR_FOLDER "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/${child}" )
|
||||||
if( NOT WIN32 )
|
add_pass_tests( "${CUR_FOLDER}/*.pass.cpp" ${child} )
|
||||||
add_fail_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/date_test/*.fail.cpp" "date_test" )
|
if( NOT WIN32 )
|
||||||
add_fail_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/iso_week_test/*.fail.cpp" "iso_week_test" )
|
add_fail_tests( "${CUR_FOLDER}/*.fail.cpp" ${child} )
|
||||||
add_fail_tests( "${PROJECT_SOURCE_DIR}/${TEST_FOLDER}/tz_test/*.fail.cpp" "tz_test" )
|
endif( )
|
||||||
endif( )
|
endif( )
|
||||||
|
endforeach( )
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export TEST_BIN_NAME=$1
|
export TEST_BIN_NAME=$1
|
||||||
echo "Building ${TEST_BIN_NAME}"
|
#echo "Building ${TEST_BIN_NAME}"
|
||||||
shift 1
|
shift 1
|
||||||
export BUILD_COMMAND=$@
|
export BUILD_COMMAND=$@
|
||||||
echo "Build command: ${BUILD_COMMAND}"
|
#echo "Build command: ${BUILD_COMMAND}"
|
||||||
eval ${BUILD_COMMAND} #>/dev/null 2>/dev/null
|
eval ${BUILD_COMMAND} >/dev/null 2>/dev/null
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -ne "#!/bin/bash\nexit 1;" > ${TEST_BIN_NAME}
|
echo -ne "#!/bin/bash\nexit 1;" > ${TEST_BIN_NAME}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user