cmake: run notcurses-tester first among tests

This commit is contained in:
nick black 2020-12-06 12:36:31 -05:00
parent 2922b8c663
commit cc5f9f0cb7
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -550,6 +550,28 @@ endif()
# Testing
if(${BUILD_TESTING})
#set(CMAKE_CTEST_ARGUMENTS "-V")
if(${USE_DOCTEST})
file(GLOB TESTSRCS CONFIGURE_DEPENDS tests/*.cpp)
add_executable(notcurses-tester ${TESTSRCS})
target_include_directories(notcurses-tester
PRIVATE
include
"${PROJECT_BINARY_DIR}/include"
src/lib
)
target_link_libraries(notcurses-tester
PRIVATE
unistring
notcurses++
"${TERMINFO_LIBRARIES}"
)
add_test(
NAME notcurses-tester
COMMAND notcurses-tester -p ${CMAKE_CURRENT_SOURCE_DIR}/data
)
set_tests_properties(notcurses-tester PROPERTIES RUN_SERIAL TRUE)
install(TARGETS notcurses-tester DESTINATION bin)
endif()
enable_testing()
# the accursed Ubuntu buildd sets "TERM=unknown" for unfathomable reasons
if(DEFINED ENV{TERM} AND NOT $ENV{TERM} STREQUAL "unknown" AND USE_POC)
@ -581,28 +603,6 @@ set_tests_properties(ncpp_build ncpp_build_exceptions rgb rgbbg
PROPERTIES RUN_SERIAL TRUE
)
endif()
if(${USE_DOCTEST})
file(GLOB TESTSRCS CONFIGURE_DEPENDS tests/*.cpp)
add_executable(notcurses-tester ${TESTSRCS})
target_include_directories(notcurses-tester
PRIVATE
include
"${PROJECT_BINARY_DIR}/include"
src/lib
)
target_link_libraries(notcurses-tester
PRIVATE
unistring
notcurses++
"${TERMINFO_LIBRARIES}"
)
add_test(
NAME notcurses-tester
COMMAND notcurses-tester -p ${CMAKE_CURRENT_SOURCE_DIR}/data
)
set_tests_properties(notcurses-tester PROPERTIES RUN_SERIAL TRUE)
install(TARGETS notcurses-tester DESTINATION bin)
endif()
endif()
add_custom_target(demo