Commit Graph

11 Commits

Author SHA1 Message Date
Uli Schlachter 6534208f62 tests/_runner.lua: Use less waiting
Before this, the test runner used a timer which fired every 0.1 seconds
to "do its thing". Many of these waits seem unnecessary.

This commit makes the test runner wait 0 seconds for the first call of a
step function. Only following calls will have a timeout of 0.1 seconds
applied.

A full run of the test suite (tests/run.sh without further arguments)
took about 100 seconds before this change. After this change, we are
down to 60 seconds. This is almost factor two faster! (Well, five thirds
is the exact number, so factor 1.66)

(The numbers are best out of three runs. The "before" number is rounded
down while the "after" number is rounded up.)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 19:34:41 +01:00
Daniel Hahler 68de588f21 tests: fix indenting/style (#1303)
Basically:

> for f in **/*.lua; do vim '+set sw=4' '+norm gg=G' '+wq' "$f"; done
2016-12-27 21:39:08 +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
Uli Schlachter e18bece3df Make tests more reliable on "early errors"
When e.g. test-leaks.lua fails, it will cause a Lua error before starting the
test runner. This means that the test will just hang, because nothing causes
awesome to quit.

Handle this by starting a timer when the test runner is loaded and quitting
awesome in there if no test run was started yet. This only works if all tests
load the runner before doing anything that could fail, so the require("_runner")
is moved to the beginning in every test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-06 10:20:45 +01:00
Daniel Hahler 9257c96b7c Merge pull request #690 from psychon/make-test-runner-more-robust
Make the functional test runner more robust
2016-02-16 01:03:06 +01:00
Uli Schlachter f87da55dfc Make the functional test runner more robust
Currently, an error in the default config in the right place isn't noticed. Fix
this by doing two things:

- Also grep for "error" (this catches runtime errors with a stack trace)
- Make _runner print a "success" message at the end and also grep for that

Fixes: https://github.com/awesomeWM/awesome/issues/689
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-13 07:36:59 +01:00
Uli Schlachter bf3b9b5f42 tests: Fix luacheck warnings
This leaves one warning in tests/test-urgent.lua which points out an actual
bug/problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:12:41 +01:00
Uli Schlachter 63653bed76 Add the right vim modeline to all lua files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:33 +01: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
Daniel Hahler 22624284a2 tests/_runner.lua: use xpcall+traceback with step error handler 2015-07-22 13:52:47 +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