Browse Source

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

Emmanuel Lepage Vallee 5 months ago
parent
commit
067f8f4ebf
3 changed files with 18 additions and 5 deletions
  1. 4
    3
      .travis.yml
  2. 6
    0
      CMakeLists.txt
  3. 8
    2
      tests/run.sh

+ 4
- 3
.travis.yml View File

@@ -50,14 +50,14 @@ addons:
50 50
 
51 51
 jobs:
52 52
   include:
53
-    - env: LUA=5.2 LUANAME=lua5.2 DO_COVERAGE=coveralls
53
+    - env: LUA=5.2 LUANAME=lua5.2 DO_COVERAGE=coveralls MANUAL_SCREENS=1
54 54
       addons:
55 55
         apt:
56 56
           packages:
57 57
             - *BASE_PACKAGES
58 58
             - liblua5.2-dev
59 59
             - lua5.2
60
-    - env: LUA=5.3 LUANAME=lua5.3 DO_COVERAGE=codecov
60
+    - env: LUA=5.3 LUANAME=lua5.3 DO_COVERAGE=codecov MANUAL_SCREENS=1
61 61
       addons:
62 62
         apt:
63 63
           packages:
@@ -229,7 +229,8 @@ install:
229 229
       return 0
230 230
     }
231 231
 script:
232
-  - 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"
232
+  - if [ "$MANUAL_SCREENS" != "1" ]; then export MANUAL_SCREENS=0; fi
233
+  - 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"
233 234
   - |
234 235
     if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then
235 236
       # Break beautiful so that trying to access the theme before beautiful.init() causes an error

+ 6
- 0
CMakeLists.txt View File

@@ -404,6 +404,12 @@ target_link_libraries(test-gravity
404 404
 if(DO_COVERAGE)
405 405
     set(TESTS_RUN_ENV DO_COVERAGE=1)
406 406
 endif()
407
+
408
+# Start AwesomeWM tests with `--screen off`
409
+if ("${TEST_MANUAL_SCREENS}" MATCHES "1")
410
+    set(TEST_RUN_ARGS "--W --m")
411
+endif()
412
+
407 413
 add_custom_target(check-integration
408 414
     ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${TESTS_RUN_ENV} ./tests/run.sh \$\${TEST_RUN_ARGS:--W}
409 415
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}

+ 8
- 2
tests/run.sh View File

@@ -23,16 +23,19 @@ Usage: $0 [OPTION]... [FILE]...
23 23
 Options:
24 24
   -v: verbose mode
25 25
   -W: warnings become errors
26
+  -m: Use --screen off
26 27
   -h: show this help
27 28
 EOF
28 29
     exit "$1"
29 30
 }
30 31
 fail_on_warning=
32
+manual_screens=
31 33
 verbose=${VERBOSE:-0}
32
-while getopts vWh opt; do
34
+while getopts vWmh opt; do
33 35
     case $opt in
34 36
         v) verbose=1 ;;
35 37
         W) fail_on_warning=1 ;;
38
+        m) manual_screens=" --screen off" ;;
36 39
         h) usage 0 ;;
37 40
         *) usage 64 ;;
38 41
     esac
@@ -105,7 +108,9 @@ fi
105 108
 
106 109
 # Add test dir (for _runner.lua).
107 110
 # shellcheck disable=SC2206
108
-awesome_options=($AWESOME_OPTIONS --search lib --search "$this_dir")
111
+awesome_options=($AWESOME_OPTIONS $manual_screens --search lib --search "$this_dir")
112
+
113
+awesome_options+=(--screen off)
109 114
 
110 115
 # Cleanup on errors / aborting.
111 116
 cleanup() {
@@ -172,6 +177,7 @@ fi
172 177
 # Start awesome.
173 178
 start_awesome() {
174 179
     cd "$build_dir"
180
+
175 181
     # Kill awesome after $TEST_TIMEOUT seconds (e.g. for errors during test setup).
176 182
     # SOURCE_DIRECTORY is used by .luacov.
177 183
     DISPLAY="$D" SOURCE_DIRECTORY="$source_dir" \

Loading…
Cancel
Save