From d2fd15cf993c77e4e402dea3af36ad9d047ea252 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 11 Jan 2019 17:04:23 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 7 +++++-- tests/themes/run.sh | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 224f2a1eb..9d3d3b4da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -400,15 +400,18 @@ add_custom_target(check DEPENDS check-integration) add_executable(test-gravity tests/test-gravity.c) target_link_libraries(test-gravity ${AWESOME_COMMON_REQUIRED_LDFLAGS} ${AWESOME_REQUIRED_LDFLAGS}) +if(DO_COVERAGE) + set(TESTS_RUN_ENV DO_COVERAGE=1) +endif() 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} COMMENT "Running integration tests" DEPENDS ${PROJECT_AWE_NAME} USES_TERMINAL) add_dependencies(check-integration test-gravity) 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} COMMENT "Testing themes" USES_TERMINAL diff --git a/tests/themes/run.sh b/tests/themes/run.sh index c2abda2e7..a1136bf20 100755 --- a/tests/themes/run.sh +++ b/tests/themes/run.sh @@ -3,6 +3,8 @@ # Test all themes. # This should be run via `make check-themes` (or manually from the build # directory). +# +# It uses tests/run.sh internally, which handles coverage. set -e