tests: Use --screen manual for both code coverage jobs.

This commit is contained in:
Emmanuel Lepage Vallee 2019-06-13 00:35:32 -04:00
parent 852ff9c340
commit 067f8f4ebf
3 changed files with 18 additions and 5 deletions

View File

@ -50,14 +50,14 @@ addons:
jobs: jobs:
include: 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: addons:
apt: apt:
packages: packages:
- *BASE_PACKAGES - *BASE_PACKAGES
- liblua5.2-dev - liblua5.2-dev
- lua5.2 - 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: addons:
apt: apt:
packages: packages:
@ -229,7 +229,8 @@ install:
return 0 return 0
} }
script: 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 if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then
# Break beautiful so that trying to access the theme before beautiful.init() causes an error # Break beautiful so that trying to access the theme before beautiful.init() causes an error

View File

@ -404,6 +404,12 @@ target_link_libraries(test-gravity
if(DO_COVERAGE) if(DO_COVERAGE)
set(TESTS_RUN_ENV DO_COVERAGE=1) set(TESTS_RUN_ENV DO_COVERAGE=1)
endif() 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 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} ${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}

View File

@ -23,16 +23,19 @@ Usage: $0 [OPTION]... [FILE]...
Options: Options:
-v: verbose mode -v: verbose mode
-W: warnings become errors -W: warnings become errors
-m: Use --screen off
-h: show this help -h: show this help
EOF EOF
exit "$1" exit "$1"
} }
fail_on_warning= fail_on_warning=
manual_screens=
verbose=${VERBOSE:-0} verbose=${VERBOSE:-0}
while getopts vWh opt; do while getopts vWmh opt; do
case $opt in case $opt in
v) verbose=1 ;; v) verbose=1 ;;
W) fail_on_warning=1 ;; W) fail_on_warning=1 ;;
m) manual_screens=" --screen off" ;;
h) usage 0 ;; h) usage 0 ;;
*) usage 64 ;; *) usage 64 ;;
esac esac
@ -105,7 +108,9 @@ fi
# Add test dir (for _runner.lua). # Add test dir (for _runner.lua).
# shellcheck disable=SC2206 # 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 on errors / aborting.
cleanup() { cleanup() {
@ -172,6 +177,7 @@ fi
# Start awesome. # Start awesome.
start_awesome() { start_awesome() {
cd "$build_dir" cd "$build_dir"
# Kill awesome after $TEST_TIMEOUT seconds (e.g. for errors during test setup). # Kill awesome after $TEST_TIMEOUT seconds (e.g. for errors during test setup).
# SOURCE_DIRECTORY is used by .luacov. # SOURCE_DIRECTORY is used by .luacov.
DISPLAY="$D" SOURCE_DIRECTORY="$source_dir" \ DISPLAY="$D" SOURCE_DIRECTORY="$source_dir" \