Commit Graph

81 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 3a12e6d274 tests: Test Lua side screen management. 2019-09-29 19:07:24 -04:00
Emmanuel Lepage Vallee 067f8f4ebf tests: Use --screen manual for both code coverage jobs. 2019-09-29 18:56:06 -04:00
Daniel Hahler 13ea02eeeb
tests/run.sh: do not export XDG_CONFIG_HOME (#2876)
Only set it for the "awesome" process invocation.
2019-09-13 17:55:27 +02:00
Daniel Hahler 9b86a03b66
tests: do not export build_dir (#2875)
If really necessary this should be an uppercased var, but it is only
used with test-gravity.lua, where we can just rely on `$PWD` being the
build dir.
2019-09-13 17:55:06 +02:00
Daniel Hahler a7674f2359
tests/run.sh: output "awesome --version" (#2872)
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.
2019-09-13 16:02:22 +02:00
Emmanuel Lepage Vallee e076bc664e naughty: Bump the SPEC version compliance to v1.2.
* 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.
2019-08-03 01:45:22 -04:00
Daniel Hahler 5dbb5b4992 tests/run.sh: fix handling of test args
Fixes `tests/run.sh tests/test-signal.lua`.
2019-01-03 13:54:37 +01:00
Uli Schlachter 0e94f8bd6b tests/run.sh: Print log on awesome-client failures
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>
2018-08-06 16:03:17 +02:00
Yauhen Kirylau 4bd5b1940d feat(themes; beautiful): add partial support for GTK+3 themes (#2129) 2018-06-26 10:43:20 -04:00
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