mirror of
https://github.com/SFML/SFML.git
synced 2025-01-19 15:55:13 +08:00
Simplify how test runner command is created
This commit is contained in:
parent
88d40412d7
commit
b2e918bafc
@ -157,14 +157,10 @@ if(SFML_ENABLE_COVERAGE AND OpenCppCoverage_FOUND)
|
|||||||
string(REPLACE "/" "\\" COVERAGE_SRC "${PROJECT_SOURCE_DIR}/src")
|
string(REPLACE "/" "\\" COVERAGE_SRC "${PROJECT_SOURCE_DIR}/src")
|
||||||
string(REPLACE "/" "\\" COVERAGE_INCLUDE "${PROJECT_SOURCE_DIR}/include")
|
string(REPLACE "/" "\\" COVERAGE_INCLUDE "${PROJECT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
add_custom_command(TARGET runtests
|
set(COVERAGE_PREFIX ${OpenCppCoverage_BINARY} ARGS --quiet --export_type cobertura:${PROJECT_BINARY_DIR}/coverage.out --cover_children --excluded_modules "${COVERAGE_EXCLUDE}" --sources "${COVERAGE_SRC}" --sources "${COVERAGE_INCLUDE}" --)
|
||||||
COMMENT "Run tests"
|
|
||||||
POST_BUILD COMMAND "${OpenCppCoverage_BINARY}" ARGS --quiet --export_type cobertura:${PROJECT_BINARY_DIR}/coverage.out --cover_children --excluded_modules "${COVERAGE_EXCLUDE}" --sources "${COVERAGE_SRC}" --sources "${COVERAGE_INCLUDE}" -- "${CMAKE_CTEST_COMMAND}" --output-on-failure -C $<CONFIG>
|
|
||||||
VERBATIM)
|
|
||||||
else()
|
|
||||||
# Run tests without a coverage runner
|
|
||||||
add_custom_command(TARGET runtests
|
|
||||||
COMMENT "Run tests"
|
|
||||||
POST_BUILD COMMAND "${CMAKE_CTEST_COMMAND}" --output-on-failure -C $<CONFIG>
|
|
||||||
VERBATIM)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(TARGET runtests
|
||||||
|
COMMENT "Run tests"
|
||||||
|
POST_BUILD COMMAND ${COVERAGE_PREFIX} ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>
|
||||||
|
VERBATIM)
|
||||||
|
Loading…
Reference in New Issue
Block a user