This commit makes all C code that previously returned a screen index now return
a screen object, continuing the deprecation of screen indicies. Note that this
is an API break and will likely cause all kinds of problems for users.
The change also breaks some tests which are suitably fixed in this commit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
Step 1 starts a client and uses awful.rules to move it to a not-selected tag.
Because this rule still has focus=true, this calls awful.ewmh.activate() via the
request::activate signal. This function makes the client urgent because it is on
a not-selected tag.
Step 3 does the same thing, but also uses switchtotag=true. Now
awful.ewmh.activate() doesn't make the client urgent because it successfully
focused this client. However, the test was wrongly assuming that the client
became urgent (copy&paste error? I don't know).
The fix is of course not to require the client to become urgent.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
Both the test runner and the wibox use gears.timer.delayed_call(). The test
runner uses this to call steps and the wibox uses it to trigger redraws. When
running under LuaCov, the Lua code becomes slow enough that the wibox didn't
redraw yet when the leak check is run. This causes the check to fail, because
the client is still referenced by the tasklist and thus cannot be garbage
collected.
Fix this by waiting one more iteration before running the leak check.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This opens xterm, closes it and makes sure that the client object representing
xterm is GC'able at the end. The test will fail currently.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The benchmarks in tests/test-benchmark.lua have two modes. When CI=1 is set in
the environment, only a "quick" and less exact test is done. Otherwise, a slower
and more exact measurements is taken. This was added so that we do not waste CPU
time on travis.
However, most of the time the user running "make check" doesn't want exact
measurements either. So instead of only being quick when CI=1 is set, this
commit changes the logic to always being quick unless BENCHMARK_EXACT=1 is set.
Additionally, a message is printed next to the benchmark results so that the
user is reminded to set this var if the measurements should actually mean
something.
Signed-off-by: Uli Schlachter <psychon@znc.in>
While setting up an environment to run the integration tests in, the run.sh
script uses sed to generate versions of several files that refer to the
not-installed version of files. One of these needs to replace the call to
beautiful.init().
Before commit 20c9723c5b, the corresponding line was:
beautiful.init("@AWESOME_THEMES_PATH@/default/theme.lua")
Now this wants to find and replace the following:
beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua")
To handle both versions, this commit adds some wildcards to the sed-expression
so that any line containing a call to beautiful.init is found and replaced.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Having many arguments can easily get confusing and hard to understand. This
commit uses a table instead so that we have names that identify what each
callback does.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When using `spawn` without startup notification support, the
`startup_id` property on the client should be nil.
This adds rxvt-unicode to the Travis build, because it supports startup
notifications, but xterm does not. We should replace xterm with it in
the existing tests then later.
* This commit add a new module to avoid a (4 level) loop dependency
* It is now possible to call awful.spawn() with a table of properties
* awful.rules is used to execute the rules.
* Everything is public to allow alternative workflow modules such as
Tyrannical to use their own callback implementation.