From 067f8f4ebf60515b75da8c6207eb6eb7b6d2628b Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 13 Jun 2019 00:35:32 -0400 Subject: [PATCH] tests: Use --screen manual for both code coverage jobs. --- .travis.yml | 7 ++++--- CMakeLists.txt | 6 ++++++ tests/run.sh | 10 ++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75a8cd0f5..039f0fed6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,14 +50,14 @@ addons: jobs: include: - - env: LUA=5.2 LUANAME=lua5.2 DO_COVERAGE=coveralls + - env: LUA=5.2 LUANAME=lua5.2 DO_COVERAGE=coveralls MANUAL_SCREENS=1 addons: apt: packages: - *BASE_PACKAGES - liblua5.2-dev - lua5.2 - - env: LUA=5.3 LUANAME=lua5.3 DO_COVERAGE=codecov + - env: LUA=5.3 LUANAME=lua5.3 DO_COVERAGE=codecov MANUAL_SCREENS=1 addons: apt: packages: @@ -229,7 +229,8 @@ install: return 0 } script: - - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -DSTRICT_TESTS=true -D DO_COVERAGE=$DO_COVERAGE -D CMAKE_C_FLAGS=-Werror" + - if [ "$MANUAL_SCREENS" != "1" ]; then export MANUAL_SCREENS=0; fi + - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -D LUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -D STRICT_TESTS=true -D DO_COVERAGE=$DO_COVERAGE -D TEST_MANUAL_SCREENS=$MANUAL_SCREENS -D CMAKE_C_FLAGS=-Werror" - | if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then # Break beautiful so that trying to access the theme before beautiful.init() causes an error diff --git a/CMakeLists.txt b/CMakeLists.txt index ed9a35b14..68d2accc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,6 +404,12 @@ target_link_libraries(test-gravity if(DO_COVERAGE) set(TESTS_RUN_ENV DO_COVERAGE=1) endif() + +# Start AwesomeWM tests with `--screen off` +if ("${TEST_MANUAL_SCREENS}" MATCHES "1") + set(TEST_RUN_ARGS "--W --m") +endif() + add_custom_target(check-integration ${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} diff --git a/tests/run.sh b/tests/run.sh index 564b1c29d..45add1a2c 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -23,16 +23,19 @@ Usage: $0 [OPTION]... [FILE]... Options: -v: verbose mode -W: warnings become errors + -m: Use --screen off -h: show this help EOF exit "$1" } fail_on_warning= +manual_screens= verbose=${VERBOSE:-0} -while getopts vWh opt; do +while getopts vWmh opt; do case $opt in v) verbose=1 ;; W) fail_on_warning=1 ;; + m) manual_screens=" --screen off" ;; h) usage 0 ;; *) usage 64 ;; esac @@ -105,7 +108,9 @@ fi # Add test dir (for _runner.lua). # shellcheck disable=SC2206 -awesome_options=($AWESOME_OPTIONS --search lib --search "$this_dir") +awesome_options=($AWESOME_OPTIONS $manual_screens --search lib --search "$this_dir") + +awesome_options+=(--screen off) # Cleanup on errors / aborting. cleanup() { @@ -172,6 +177,7 @@ fi # Start awesome. start_awesome() { cd "$build_dir" + # Kill awesome after $TEST_TIMEOUT seconds (e.g. for errors during test setup). # SOURCE_DIRECTORY is used by .luacov. DISPLAY="$D" SOURCE_DIRECTORY="$source_dir" \