Commit Graph

72 Commits

Author SHA1 Message Date
Uli Schlachter 619d922538 tests/run.sh: Allow setting timeout via $TEST_TIMEOUT (#2281)
This allows to e.g. easily run awesome from source (for an hour) via
TEST_TIMEOUT=42d tests/run.sh /dev/null.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-06-12 13:16:44 -04:00
Daniel Hahler b0220a3804 tests: do not set Xft.dpi with integration tests (#2121)
This should help with covering the methods for detection/fallback during
tests.

Ref: https://github.com/awesomeWM/awesome/pull/2109#issuecomment-346224956

Uses xrdb -q to check for X server being available.

Ignores the following warning:

> W: awesome: beautiful: can't get colorscheme from xrdb (using fallback).
2017-11-23 23:26:54 -05:00
Daniel Hahler 73ebf452ec
tests: improve coverage with integration tests (#2082)
- install luacov.runner in tests/_runner.lua.
- use Lua's `dofile` to execute the test files, which will give us
  coverage for them.
- CMakeLists.txt: revert DO_COVERAGE env injection
- revert cd: make f absolute if not in source_dir
2017-11-18 01:52:48 +01:00
Daniel Hahler a5e00347e1 tests: tests/run.sh: timeout after 30 seconds (#2083) 2017-10-24 00:29:56 +02:00
actionless 596b7443e7 feat(tests: run.sh): treat luaA_panic as an error 2017-08-24 23:16:53 +02:00
actionless 162cf1854c fix(tests: run.sh): add one more error log pattern 2017-08-24 23:16:53 +02:00
Daniel Hahler cdaf0dd294 tests/run.sh: fix verbose mode (#1997)
Fixes https://github.com/awesomeWM/awesome/issues/1996.

Also improves usage information.
2017-08-16 11:27:32 +02:00
Daniel Hahler 52548a2bee tests/run.sh: add -v option, replacing/using VERBOSE 2017-08-15 16:58:24 +02:00
Daniel Hahler e852455308 tests/run.sh: add support for -W to turn warnings into errors 2017-08-14 13:42:13 +02:00
Daniel Hahler 26f32f5ce4 tests/run.sh: cleanup: wait for process(es) to finish (#1982)
Ref: https://github.com/awesomeWM/awesome/pull/1967#issuecomment-321978955
2017-08-13 11:57:59 +02:00
Daniel Hahler f36738f115 tests/run.sh: allow to provide RC_FILE and theme/icon paths 2017-08-11 20:01:37 +02:00
Daniel Hahler fb18a1d159 tests/run.sh: use temporary RC_FILE again (#1910)
This was changed in ec9a981d for no good reason, and using a temporary
file removes the requirement to restore it on exit.
And it is necessary in case the original file is not writable (e.g. in
case of a read-only Docker mount).
2017-07-09 22:29:51 +02:00
Daniel Hahler 2f105a405f Improve tests/run.sh (#1904)
- add colors
- count test files
- display error summary
- filter out a_dbus_connect warnings and "Test finished successfully." message
- print current step with VERBOSE=1
- kill clients at the end of tests in an extra step
2017-07-09 14:17:35 +02:00
Uli Schlachter 3ed0be6d85 Add a test for gravity handling (#1760)
This adds a C program which tests if the window manager handles
gravities correctly. This program is loosely based on metacity's
test-gravity.c, but completely rewritten and this version does automatic
tests instead of allowing the user to perform testing by hand.

By having this as a self-contained C program, it is possible to compare
awesome's behaviour with the behaviour of other WMs.

In my testing, only metacity and awesome pass this test. This is not
that much of a big surprise since awesome was fixed in
https://github.com/awesomeWM/awesome/pull/505 to work correctly with
metacity's test-gravity.c. However, I am surprised that e.g. Fluxbox
gets this wrong.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:28:45 +02:00
Uli Schlachter 2f652a1de9 Speed up tests/run.sh on Travis (#1682)
tests/run.sh waits for awesome to exit via tail's "--pid" option. This
makes tail check once per second if the process still exists and if not,
tail will exit. However, the default of "once per second" causes lots of
wasted time for us.

This commit adds the argument "-s 0.1" to tail which makes tail check
once every 0.1 seconds. This commit changes the time that "tests/run.sh"
runs on Travis from about 60 seconds to about 35 seconds, which is a big
improvement.

Closes: https://github.com/awesomeWM/awesome/issues/1374
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-29 18:46:47 +02:00
Daniel Hahler ec9a981dd7 tests: move coverage setup into tests/run.sh
This allows for `DO_COVERAGE=1 make check` with local tests (where
`CI=true` is not given).
It uses the new environment variables to configure the default theme,
instead of creating a temporary config/theme.
2017-01-08 20:34:13 +01:00
Daniel Hahler 6aee6c2053 ci: overhaul coverage processing
- Execute the tests without compiling, and don't mess with the source
   files when coverage is enabled.
   This ensures that the coverage report lines are correct.
   This disables the doc tests, as their results would be unused.
   Hack: it still expands macros on util.lua, because of
   `util.get_themes_dir()` and `util.get_awesome_icon_dir()`, which might
   be moved later.  Ref:
   https://github.com/awesomeWM/awesome/pull/1239#discussion_r93828178.
 - ensure that BUILD_APIDOC and DO_COVERAGE are not used together
 - awesomeConfig.cmake: add DO_COVERAGE as an option
 - Travis: only install codecov with DO_COVERAGE=codecov
 - Travis: do not use set -v; use set -x with DO_COVERAGE
 - do not use trailing slashes with dirs in tests/examples/CMakeLists.txt / .luacov
 - Use latest luacov (0.12.0-1) again
   This reverts parts of 4cc6a815.
   I think it is better to fix any failure that 4cc6a815 tried to work around.
 - Travis: simplify/fix require('luacov') for functionaltests
 - tests/examples/CMakeLists.txt: resolve ../.. in SOURCE_DIR
 - tests/examples/CMakeLists.txt: add DO_COVERAGE to env
 - Cleanup/simplify .luacov: work with SOURCE_DIRECTORY alone
 - tests/run.sh: pass through / set SOURCE_DIRECTORY when running awesome
 - tests/run.sh: resolve source_dir
 - use DO_COVERAGE from env only
2017-01-08 20:34:13 +01:00
Uli Schlachter f7025e2f73 Fix tests/run.sh
Commit a944636c02 "bashified" tests/run.sh for some reason.
Afterwards, commit 4abd820051 fixed some of the fall-out.
However, there is still a problem left.

We have "set -e" in this script. Thus, whenever some command exits with
status 0, the script abort. When the variable errors is zero/unset, the
command "((errors++))" has exit status zero. Thus, this instruction
caused the shell script to abort. This was not intended.

Fix this by using "((++errors))" instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 19:35:13 +01:00
Daniel Hahler 58773488e4 tests: do not set -x by default on Travis (#1318)
This is rather noisy, and the test runner should not require this anymore for debugging.

[ci skip]
2016-12-28 12:43:00 +01:00
Daniel Hahler 8f8094b57e tests/run.sh: allow to pass full file name
This is easier with shell completion.
2016-12-27 02:43:05 +01:00
Daniel Hahler 8e97ae51c3 tests/run.sh: remove exclamation mark for better copy'n'paste experience
Closes https://github.com/awesomeWM/awesome/pull/1293.
2016-12-27 02:43:05 +01:00
Daniel Hahler 4abd820051 tests: fix incrementing errors (#1297) 2016-12-25 15:13:22 +01:00
Daniel Hahler fb874122ba tests/run.sh: SHELL=/bin/sh, HOME=/dev/null (#1291) 2016-12-25 03:46:28 +01:00
Daniel Hahler d5b3fa8be0 Merge pull request #1290 from blueyed/tests-run-shellcheck-etc
tests/run.sh: shellcheck and other fixes
2016-12-25 03:43:50 +01:00
Daniel Hahler 58067834ad tests: remove TEST_QUIT_ON_TIMEOUT/quit_awesome_on_timeout (#1288)
It was set to 1 unconditionally anyway, and does not make sense to parametrize after all.
2016-12-25 03:43:03 +01:00
Daniel Hahler 8c9a1b5491 fixup! tests/run.sh: shellcheck and other fixes 2016-12-25 03:09:43 +01:00
Daniel Hahler a944636c02 tests/run.sh: shellcheck and other fixes 2016-12-25 03:08:35 +01:00
Emmanuel Lepage Vallée 8935ed2a30 Remove traces of the old URL (#1280)
**WARNING**: This breaks the API
2016-12-21 02:03:03 +01:00
Emmanuel Lepage Vallee 771f5a13c6 tests: Bump the timeout to 3 minutes.
There we go again... When hitting a slow CI node, there is again
timeouts when doing the multi-screen tests. As no solution to
bug leading to this has been found, the only thing to do is
increase the timeout.

Hopefully this commit will be reverted soon.
2016-12-01 19:34:46 -05:00
Uli Schlachter b2e0e55fc0 tests/run.sh: Inherit $HEADLESS (#1201)
Via this, I can set HEADLESS=1 in my wrapper-GNUMakefile that I use and
"make check" will no longer open a new window that gets in my way.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-31 23:22:31 +01:00
Uli Schlachter cea5d41518 tests/run.sh: Use dbus-send directly with low timeouts (#1116)
run.sh waits for awesome's startup to be done by having awesome execute "return
1" via its dbus interface. However, by default dbus has a 25 second timeout
before it fails a dbus-send invocation. This defeats the purpose of this
exercise.

So instead of using awesome-client, this commit makes the code use dbus-send
directly and specifies a relative low reply timeout (which should still be
plenty so that this doesn't erroneously fail).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-25 20:28:27 +02:00
Uli Schlachter a430ac1e23 tests/run.sh: Print special message for timeout
The timeout utility guarantees an exit code of 124 when the process died due to
timeout. Since awesome only ever exits with 0 or 1, we can use this to reliably
detect timeouts and print a matching message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-25 06:00:15 +02:00
Uli Schlachter 60ee10cfff tests/run.sh: Use the "timeout" command
coreutils provides a timeout command. Use that instead of (badly) inventing our
own version of it. This "timeout" command seems to be new. Let's hope everyone
has it and think about alternative solutions only when needed.

Fixes: https://github.com/awesomeWM/awesome/issues/1075
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 15:56:36 +02:00
Uli Schlachter 62d0961994 tests/run.sh: Show awesome's exit code
When awesome exits with a non-zero code, this is something interesting that we
should log. Do so.

The "set +e" / "set -e" dance is required so that we do not abort because the
wait builtin returns a non-zero code.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 15:55:24 +02:00
Uli Schlachter 86ee5bb750 tests/run.sh: Don't fail because of grep
This script runs under "set -e", so any command exiting with a non-zero status
makes it abort. However, we do not care about failures from grep to find
anything, so handle that case gracefully.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 15:53:35 +02:00
Daniel Hahler b4d6bfa4db Travis: fix codecov (#1105)
tests/run.sh: no slash with --search lib

Fixes https://github.com/awesomeWM/awesome/issues/1049.
2016-09-20 19:53:10 +02:00
Emmanuel Lepage Vallee 35c0476c86 tests: Increase time limit to 120 seconds
The "test launching client on a specific screen" suit is very slow.

However, it is also necessary to avoid issues such as #1069 or #154
from regressing again.

This is a temporary fix until a faster test client "daemon" is
developped.
2016-09-07 00:40:30 -04:00
Uli Schlachter cf89f108ac Make use of awesome-client commands
This uses the new support introduced in f0f31bc305 in the docs and in
tests/run.sh, removing an useless use of cat/echo.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 17:45:37 +02:00
Uli Schlachter 71049a67f7 tests/run.sh: Use --search instead of $LUA_PATH
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-20 16:04:11 +02:00
Daniel Hahler e8dfe36c59 tests/run: change to script dir first
Then use `$source_dir` for detecting the build dir: this way you can run
`./run.sh some-test-file.lua` from `./tests/`.
2016-07-21 19:08:43 +02:00
Emmanuel Lepage Vallée 36e47fb1a9 tests: Don't use arbitrary build dir path (#898)
Calling the test script by hand from the build dir stopped working.
2016-06-12 23:28:32 +02:00
Daniel Hahler eaa80fef9a tests/run: clarify timeout in wait_until_success
Ref: https://github.com/awesomeWM/awesome/pull/937#discussion-diff-65313945
2016-06-05 17:05:23 +02:00
Daniel Hahler 8e221522f7 Travis: kill awesome after max. 60s per test file
This is required for when the test setup fails already, e.g. because of
an assertion error at the top of a test file.
2016-06-05 17:05:23 +02:00
Uli Schlachter 9d30bf87ae Merge branch 'more-travis-variance' of https://github.com/psychon/awesome 2016-05-09 18:42:09 +02:00
Uli Schlachter 1ab3f43575 Merge branch 'useful-env-vars' of https://github.com/psychon/awesome 2016-05-09 18:41:02 +02:00
Daniel Hahler 58209cd89e Use an uneven screen width/height (1921x1079) in one Travis job (#870)
This is meant to trigger issues that would need `math.ceil()` fixes etc.

Ref: https://github.com/awesomeWM/awesome/issues/848#issuecomment-216068831
2016-05-08 20:58:19 +02:00
Uli Schlachter 7ea816045d "make check": Support out-of-tree builds
Currently, tests/run.sh expects the directory layout that our wrapper Makefile
sets up before running CMake. This commit adds support for any other directory
configuration as well.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 18:52:18 +02:00
Uli Schlachter beb9b7f950 tests/run.sh: Set up some useful env vars
GDK_SCALE=1 is needed to overwrite other settings that people might have which
would make geometry-related tests fail.

NO_AT_BRIDGE=1 gets rid of the following message that I am seeing:

** (lua:8321): WARNING **: Error retrieving accessibility bus address:
org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not
provided by any .service files

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 16:48:24 +02:00
Daniel Hahler 087d578755 tests: fail if $AWESOME does not exist / is not executable (#872)
Without this the stdout/stderr rediraction when launching it makes the
error regarding the "program not found" disappear(?!).

[ci skip]
2016-05-03 12:08:00 +02:00
Daniel Hahler b6810576b0 tests/run.sh: display number of errors [ci skip] 2016-04-06 01:54:18 +02:00