Commit Graph

22 Commits

Author SHA1 Message Date
Daniel Hahler 7c8e97ca31 Merge pull request #406 from psychon/spawn_with_pipes2
Spawn with pipes

Closes https://github.com/awesomeWM/awesome/pull/406.
2015-09-02 22:47:09 +02:00
Uli Schlachter 3c4a80ca7e Add a test for awful.util.spawn_with_line_callback
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-02 22:27:47 +02:00
Uli Schlachter 1beda989e5 tests/_runner.lua: Load all dependencies
This tried to use awful, but didn't load awful itself. Kids, this is why you
should make your variables local!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-02 21:51:20 +02:00
Uli Schlachter 4bfddbb3f8 tests/run.sh: Start Xvfb with -noreset
When using Xephyr, this already starts the server with -noreset, but for Xvfb we
also need this flag. Without this flag, the DPI value that is set via xrdb gets
lost at server reset.

This wasn't a problem before commit 6d4837a53a. That commit moved the launch
of the dbus session after the setting of the DPI. So previously, waiting for
server startup was half broken (the dbus session already tried to connect to the
server to check for when it shuts down), but due to this no server reset
occurred and thus the DPI was correctly applied. After this commit, the server
immediately resets after xrdb is done setting the DPI and the value set is lost.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-13 12:59:57 +02:00
Uli Schlachter cbba615748 tests/run.sh: Show full error messages
If an error occurs during startup, tail might not show the full error message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:30 +02:00
Uli Schlachter 0ee24317c7 tests/run.sh: Temporarily disable -x in wait_until_success
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:30 +02:00
Uli Schlachter 17e8827212 tests/run.sh: Factor out a helper function
This factors out a function wait_until_success that runs some command until it
succeeds (with a timeout) and uses this function in the two places where this
was already done before.

Note that this removes the "kill -0" trick for early exit again and instead will
use the timeout in case awesome dies during startup.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:28 +02:00
Uli Schlachter 0688e8899e tests/run.sh: Allow execution without installing
When this script is not run under Travis, it will prepare a temporary config
file and a theme file that point to the files that were not yet installed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:08 +02:00
Uli Schlachter d8a1b563e7 tests/run.sh: Use a temporary directory
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:28 +02:00
Uli Schlachter 41d81a4501 tests/run.sh: Move definition of AWESOME_CLIENT up
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:27 +02:00
Uli Schlachter 6d4837a53a tests/run.sh: Start dbus after X server startup
The code does some dances with xrdb to ensure that the server finished starting
up. However, before this it already tries to access the server via dbus-launch.

Since nothing uses dbus in this part of the code, we can just move this down.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:27 +02:00
Daniel Hahler 85facc0391 tests/run: handle 'expr 1 - 1' (exitcode 1); check for running awesome 2015-08-11 19:08:35 +02:00
Daniel Hahler 2b224dd954 tests: use root.fake_input instead of xdotool
Ref: https://github.com/awesomeWM/awesome/issues/328.
Closes: https://github.com/awesomeWM/awesome/pull/391.
2015-08-10 23:04:19 +02:00
Daniel Hahler 22624284a2 tests/_runner.lua: use xpcall+traceback with step error handler 2015-07-22 13:52:47 +02:00
Daniel Hahler f070c4e060 tests: wait until DISPLAY is ready; xrdb might complain/abort 2015-07-21 13:09:07 +02:00
Daniel Hahler 2c3c6b5ca8 tests: cleanup, remove sleep/print 2015-07-18 15:08:27 +02:00
Uli Schlachter f4ed41b39a tests: Check if test file is readable before running it
I tried calling this script with "tests/foo.lua" as an argument, but it actually
expects "foo.lua" since it changes into the appropriate directory itself.
Because this file does not exist, "cat $f | awesome-client" failed and thus this
whole script just hung (the test runner was never actually started).

Fix this by testing for the test-file to exist before trying to run it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 12:35:57 +02:00
Uli Schlachter f2a079204d tests: Make dbus session automatically exit when X server dies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 10:45:03 +02:00
Uli Schlachter 534084698b tests/run.sh: Use $! instead of pgrep
And yes, $! is specified by POSIX and thus should be portable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 10:44:16 +02:00
Daniel Hahler 430fe7f710 tests/run.sh: fix 'waiting for awesome' via pgrep 2015-07-16 17:05:46 +02:00
Daniel Hahler 1e9da0947e Improve tests/run.sh
- `set -x` only for Travis/CI=true.
 - improve waiting for PID and awesome-client success.
 - kill childs via trap always.

Closes https://github.com/awesomeWM/awesome/pull/316.
2015-07-15 01:30:06 +02:00
Daniel Hahler 611438a892 Add functional tests via Xephyr/Xvfb/xdotool
Closes https://github.com/awesomeWM/awesome/pull/133
2015-07-10 15:19:51 +02:00