cmake: pass DO_COVERAGE=1 in env for tests/run.sh (#2575)

`$DO_COVERAGE` is used in tests/run.sh, and should be set with the
`DO_COVERAGE` CMake option.
This commit is contained in:
Daniel Hahler 2019-01-11 17:04:23 +01:00 committed by GitHub
parent 0b36da2730
commit d2fd15cf99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -400,15 +400,18 @@ add_custom_target(check DEPENDS check-integration)
add_executable(test-gravity tests/test-gravity.c) add_executable(test-gravity tests/test-gravity.c)
target_link_libraries(test-gravity target_link_libraries(test-gravity
${AWESOME_COMMON_REQUIRED_LDFLAGS} ${AWESOME_REQUIRED_LDFLAGS}) ${AWESOME_COMMON_REQUIRED_LDFLAGS} ${AWESOME_REQUIRED_LDFLAGS})
if(DO_COVERAGE)
set(TESTS_RUN_ENV DO_COVERAGE=1)
endif()
add_custom_target(check-integration add_custom_target(check-integration
${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ./tests/run.sh \$\${TEST_RUN_ARGS:--W} ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${TESTS_RUN_ENV} ./tests/run.sh \$\${TEST_RUN_ARGS:--W}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running integration tests" COMMENT "Running integration tests"
DEPENDS ${PROJECT_AWE_NAME} DEPENDS ${PROJECT_AWE_NAME}
USES_TERMINAL) USES_TERMINAL)
add_dependencies(check-integration test-gravity) add_dependencies(check-integration test-gravity)
add_custom_target(check-themes add_custom_target(check-themes
${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ./tests/themes/run.sh ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${TESTS_RUN_ENV} ./tests/themes/run.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Testing themes" COMMENT "Testing themes"
USES_TERMINAL USES_TERMINAL

View File

@ -3,6 +3,8 @@
# Test all themes. # Test all themes.
# This should be run via `make check-themes` (or manually from the build # This should be run via `make check-themes` (or manually from the build
# directory). # directory).
#
# It uses tests/run.sh internally, which handles coverage.
set -e set -e