Commit Graph

284 Commits

Author SHA1 Message Date
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 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 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
Uli Schlachter 3f9da4269d Fix test in test-spawn.lua (#1298)
Copy-paste-y I was checking for the wrong result. Another unrelated
problem with the test runner caused me to miss this. Sorry!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-25 15:47:09 +01:00
Daniel Hahler 4abd820051 tests: fix incrementing errors (#1297) 2016-12-25 15:13:22 +01:00
Uli Schlachter 59cd409517 Small cleanup to test-spawn.lua
This removes a duplicate test and moves some "spawn with empty string as
argument" up to the long list of similar tests (and adds error
checking).

I do not see the point of the assert(#client.get() == 0) and so it was
just dropped.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-25 14:50:39 +01:00
Uli Schlachter 461da9ea4b Fix error handling in awesome.spawn()
Commit 5e6a893 broke error handling in awesome.spawn(): Instead of
returning an error message, it would just return its last argument.

This commit fixes that, removes some not-so-helpful warnings, and adds
lots of tests for this code.

Fixes: https://github.com/awesomeWM/awesome/issues/1281
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-25 14:50:39 +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 da415e0f9a Fix tests/test-awesomerc.lua (#1289)
Locally I got this, where only two xterms were opened.

```
% tests/run.sh test-awesomerc.lua
awesome_log: /tmp/tmp.ToAKs6Gw4J/_awesome_test.log
== Running test-awesomerc.lua ==
Error: timeout waiting for signal in step 1/11 (@20).
===> ERROR running test-awesomerc.lua! <===
Error: timeout waiting for signal in step 1/11 (@20).
There were 1 errors!
```
2016-12-25 03:43:24 +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 Vallee 2b462cb2e3 doc: Document the tag `master_fill_policy` 2016-12-21 11:41:30 -05: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
Uli Schlachter 11af40b916 Fix luacheck warnings in tests/_multi_screen.lua
This is a partial revert of commit 7901a1c647. The end result is the
same, but the change from that commit is reverted and instead the same
thing is done in a different way.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-19 09:44:26 +01:00
Uli Schlachter 939453cabe Fix luacheck warnings in the logo-tests
Ever since these files were added, these problems existed. I have no
idea what alt_fg is supposed to mean, but since a value of nil is
apparently ok, I just pass in nil directly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-18 18:59:58 +01:00
Uli Schlachter 226bb2cc31 Fix luacheck warnings in themes/xresources/assets.lua
These were introduced by commit 12e1bd6747.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-18 18:57:58 +01:00
Emmanuel Lepage Vallee 7961b8ec4b tests: Test the wallpapers 2016-12-12 13:05:08 -05:00
Emmanuel Lepage Vallee 1368212fb7 tests: Test the `tag` and `tags` rules with multiple screens 2016-12-12 11:49:11 -05:00
Emmanuel Lepage Vallee 7901a1c647 tests: Disable the wallpaper for multi-screen tests.
I really try to avoid doing this, psychon too, but enough is
enough. We don't have a solution and I would rather add more
tests that work than keeping a test that keep "failing" just
to remind us it's there.
2016-12-12 11:49:11 -05:00
Emmanuel Lepage Vallee beb997f848 tests: Test the xresource theme logo generation
As a side effect, this creates valuable SVG assets
2016-12-11 00:10:39 -05:00
Emmanuel Lepage Vallee e01de8d977 tests: Expose the themes to the examples tests 2016-12-11 00:10:39 -05:00
Uli Schlachter 9f2c4719ed Make the piechart deterministic (#1258)
Previously, the API to set the data that should be displayed was
:set_data(t) where t is a table. This table has the labels to use as its
keys and the numbers as its values. With this API, it was not possible
to influence the order in which the "pie pieces" were drawn.

This commit adds and uses a new API called :set_data_list(t). Here, t is
a table with integer keys and tables as values, thus one can iterate
over this with ipairs() and the order is well-defined. The tables used
as values contain the label as their first entry and the number as their
second entry.

Fixes: https://github.com/awesomeWM/awesome/issues/1249
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-07 20:20:09 +01:00
Uli Schlachter 5d81441c76 Make the resize_to_mouse example test deterministic (#1250)
This test has a list of "things" that should be present in the output. This
table is iterated over via pairs(), which means that the output is
non-deterministic and the order of the entries is basically random.

Fix this by using ipairs() to get a deterministic iteration order. This requires
some slight change to the table that is iterated over.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-02 21:23:36 +01:00
Uli Schlachter cb61c1884f Remove a case where a pointer appeared in text tests (#1251)
This printed a table. This will make Lua print the address of the table and
hence the output of this test was non-deterministic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-02 20:30:10 +01:00
Emmanuel Lepage Vallée 883b5934c0 Merge pull request #1236 from Elv13/fix_new_tag_rule
rules.new_tag: Fix when the tag screen doesn't match the client
2016-12-01 19:53:17 -05: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 3a7e14e5d7 Improve API of test/_client.lua
The first return value was always true. How useless...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-01 15:32:31 +01:00
Uli Schlachter f9cdc98c73 Fix spawn callbacks
Spawn callbacks were never invoked when no startup-notification-rules were
given. This commit fixes the code so that "startup done" callbacks are also
called when no rules were given.

Fixes: https://github.com/awesomeWM/awesome/issues/1218
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-01 15:32:21 +01:00
Emmanuel Lepage Vallee 28486527e7 tests: Add a `new_tag` rule multi-screen test 2016-11-27 04:57:35 -05:00
Daniel Hahler aeab2a70e9 Fix whitespace warnings reported by luacheck (#1229) 2016-11-21 22:38:23 +01:00
Emmanuel Lepage Vallée 92a494a799 Merge pull request #1182 from psychon/screen_swap
Screen swap
2016-11-07 19:23:48 -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 3ba07d77a6 Fix three typos
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-30 15:17:27 +01:00
Uli Schlachter 7712383475 Add a test for screen :swap()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-29 09:36:31 +02:00
Uli Schlachter c218b1da72 Test and fix swapping clients
The code in luaA_client_swap() is incorrect, because
luaA_object_emit_signal() already pops the arguments to the signal.
Still, the code here tried to remove the arguments from the Lua stack
again, thereby corrupting the stack (removing more items than there are
in the stack).

Normally, popping more things from the stack than it has entries
silently corrupts the Lua stack. Apparently this doesn't necessarily
cause any immediate issues, because this code has been broken since nine
months and no one noticed. This mistakes was introduced in commit
55190646.

This issue was only noticed by accident. Thus, this commit also adds a
small integration test that exercises this bug. This test catches the
issue, but only on Travis, because there we are building our own version
of Lua 5.3 and that one has assertions enabled.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-29 09:34:45 +02:00
Uli Schlachter d07fc822a1 Fix awful.tag.object.get_gap_single_client (#1190)
The usual "a or b"-trick to simulate C's ?:-operator does not work when
"false" is a valid value. Fix the code to handle this correctly and add
a short unit test which would have caught this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-26 01:43:45 +02:00
Emmanuel Lepage Vallee 072ff10cf0 tests: Test the slider widget. 2016-10-12 02:24:47 -04:00
Emmanuel Lepage Vallee a2748a1fa3 tests: Test client focus stealing filters. 2016-10-04 01:00:55 -04:00
Daniel Hahler 86bc579649 Improve messages with tests/examples/CMakeLists.txt 2016-10-01 17:24:44 +02:00
Daniel Hahler 84e7875e50 minor: fix doc for tests/examples/CMakeLists.txt 2016-10-01 17:24:03 +02:00
Uli Schlachter da6012da3e Fix memory leak in the default config on screen removal
The default config had tables like mywibox and mywibox[s] was the wibox
that is visible on screen s. When a screen is removed, nothing cleans up
these tables and so the screen and the wibox could not be garbage
collected. The same applies to the layoutbox, taglist etc.

This commit removes the global mywibox table and instead saves it as a
property on the screen. This way, the screen is not explicitly
referenced and when it is removed, the screen, its wibox and all of its
widgets become unreachable and can be garbage collected.

This commit also updates the docs and the tests that referenced things
(mostly the wibox) via mywibox[s] to now use s.mywibox.

Fixes: https://github.com/awesomeWM/awesome/issues/1125
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 22:46:51 +02:00
Uli Schlachter f9775b91de shims: Add support the new .data property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 11:11:55 +02:00
Uli Schlachter 502b4139ba Merge branch 'faster-client-deamon' 2016-09-30 10:17:35 +02:00
Uli Schlachter 8dc6c5f502 Rewrite tests/_client.lua
The new client is hopefully faster. Why, you ask?

Instead of spawning a new Lua process each time a test asks for a new window,
there is a "daemon process" which gets commands to open new windows from its
standard input. That way, Lua doesn't have to load LGI all the time and lots of
pointless work is skipped. The daemon process exits when its stdin is closed and
thus should automatically exit when awesome exits.

Fixes: https://github.com/awesomeWM/awesome/issues/1089
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 09:58:20 +02:00
Uli Schlachter 61d8d74421 Fix test-tooltip.lua: Run the event loop
This test changes the mouse cursor's position and afterwards has an
assert that checks something on the tooltip. This really looks a lot
like it expects the mouse cursor's position to be already updated and
its enter and leave events to be handled. However, this is now how
things actually work.

Fix this by moving the assert into its own step, so that in between the
normal main loop runs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 09:36:47 +02:00
Emmanuel Lepage Vallee f25621c94c tests: Test the graph shape. 2016-09-26 01:20:57 -04:00
Emmanuel Lepage Vallee 549d68dcc5 doc: Add more progressbar shape examples 2016-09-26 01:18:09 -04:00