From e852455308e4cbe67161482802edbb819097d228 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 11 Aug 2017 01:00:27 +0200 Subject: [PATCH 1/5] tests/run.sh: add support for -W to turn warnings into errors --- tests/run.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index 2a1266e7d..1a73f097c 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -15,6 +15,24 @@ set -e export SHELL=/bin/sh export HOME=/dev/null +# Parse options. +usage() { + cat >&2 < ERROR running $f <===" From 730b706217a3ff0fabbeaeaf7860d6fc7cc119ac Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 11 Aug 2017 01:03:22 +0200 Subject: [PATCH 2/5] check-integration: fail on warnings Those are most likely deprecation warnings, but the tests should be free of warnings (from awesome) anyway. The "Last main loop iteration took X seconds!" warning is filtered out. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 558b282e5..b4feb0b11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -395,7 +395,7 @@ add_executable(test-gravity tests/test-gravity.c) target_link_libraries(test-gravity ${AWESOME_COMMON_REQUIRED_LDFLAGS} ${AWESOME_REQUIRED_LDFLAGS}) add_custom_target(check-integration - sh -c "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${CMAKE_SOURCE_DIR}/tests/run.sh" + sh -c "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${CMAKE_SOURCE_DIR}/tests/run.sh -W" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Running integration tests" USES_TERMINAL From 062f9d6a15eacec9068753533b3ea8917dd75d2d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 13 Aug 2017 12:06:12 +0200 Subject: [PATCH 3/5] tests/themes/run.sh: distinguish header from tests/run.sh --- tests/themes/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/themes/run.sh b/tests/themes/run.sh index b49f82364..41a2a6b42 100755 --- a/tests/themes/run.sh +++ b/tests/themes/run.sh @@ -15,12 +15,12 @@ tests_dir="$(dirname -- "$0")/.." config_file="$build_dir/test-themes-awesomerc.lua" -for theme in themes/*/theme.lua; do - echo "== Testing $theme ==" - theme=${theme%/*} - theme=${theme##*/} +for theme_file in themes/*/theme.lua; do + echo "==== Testing theme: $theme_file ====" + theme_name=${theme_file%/*} + theme_name=${theme_name##*/} - sed "s~default/theme~$theme/theme~g" "awesomerc.lua" > "$config_file" + sed "s~default/theme~$theme_name/theme~g" "awesomerc.lua" > "$config_file" # Set CMAKE_BINARY_DIR for out-of-tree builds. CMAKE_BINARY_DIR="$PWD" \ From f8d1e46eaa7606833edbdd74005ff0a21c5e6576 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 14 Aug 2017 13:38:49 +0200 Subject: [PATCH 4/5] CMakeLists.txt: pass TEST_RUN_ARGS to tests/run.sh, default to -W --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4feb0b11..7f9ed4394 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -395,11 +395,10 @@ add_executable(test-gravity tests/test-gravity.c) target_link_libraries(test-gravity ${AWESOME_COMMON_REQUIRED_LDFLAGS} ${AWESOME_REQUIRED_LDFLAGS}) add_custom_target(check-integration - sh -c "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${CMAKE_SOURCE_DIR}/tests/run.sh -W" + ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ./tests/run.sh \$\${TEST_RUN_ARGS:--W} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Running integration tests" - USES_TERMINAL - VERBATIM) + USES_TERMINAL) add_dependencies(check-integration test-gravity) add_custom_target(check-themes ${CMAKE_SOURCE_DIR}/tests/themes/run.sh From 52548a2bee005fe3c8c8a5764acf9d695137a3a5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 14 Aug 2017 16:15:56 +0200 Subject: [PATCH 5/5] tests/run.sh: add -v option, replacing/using VERBOSE --- tests/run.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index 1a73f097c..b9ee03752 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -19,13 +19,17 @@ export HOME=/dev/null usage() { cat >&2 < 3s. while true; do set +e @@ -144,9 +145,7 @@ wait_until_success() { fi sleep 0.05 done - if [ "$VERBOSE" = 1 ]; then - set -x - fi + if [[ $verbose ]]; then set -x; fi } # Wait for DISPLAY to be available, and setup xrdb,