Commit Graph

8 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 2c08c2fa39 quality: Port all legacy `:buttons()` to `.buttons`. 2019-10-06 03:50:56 -04:00
Sergey Vlasov f08599a6d6 test-leak-client.lua: Test GC for titlebar widgets (#2830)
Add a test which recreates the titlebar for an existing client and
checks that widgets from the old titlebar instance can be GC'd.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2019-07-22 17:35:18 +03:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00
Uli Schlachter 0d8106c6dd test-leak-client.lua: Wait for c:kill() to be done
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
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
Uli Schlachter 432908dd26 Fix test-leak-client.lua under LuaCov
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>
2016-02-12 09:26:29 +01:00
Uli Schlachter e2d75dbcfd Add a functional testing for leaks with clients
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>
2016-02-04 18:24:53 +01:00