On GitHub Actions, clients created in some tests take too long to close
and still exist when the next test has started. This can affect certain
tests that rely on a specific client count or simply produce a race
condition within `scan` in `awesome.c`.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
The next commit will add modeline support. By default, modelines have
the final work on which options to set. However, mostly for testing,
this isn't flexible enough.
Might be good to have a short version of it (single line), but extra
lines are indented, so this seems to be OK.
This helps / shows when the built version is not up-to-date (e.g. after
git-bisect), and serves as a basic check that it can be run in the first
place.
* action icons
* persistence
* residence
* categories
* animated icons
* more ways to get icons
In addition, the commit also tries its best to attach notifications to
objects using various dubious semi compliant hints or the DBus PID. It
works often enough to be useful.
tests/run.sh uses awesome-client to actually make awesome run the test.
If awesome-client fails, then the only error message that is printed look like:
== Running /home/travis/build/awesomeWM/awesome/tests/test-leaks.lua ==
Error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
E: dbus-send failed.
make[4]: *** [CMakeFiles/check-integration] Error 1
To also get the output from awesome, this commit makes failures from
awesome-client non-fatal so that the following shell code can notice the
failure and hopefully print some useful information.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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).
- 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
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).
- 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
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>
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>
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.
- 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
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>
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.
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>
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>
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>
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>
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>