Commit Graph

503 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 5ab547fbfd tests: Test the awesome.modifiers 2019-01-21 01:08:48 -05:00
Daniel Hahler d2fd15cf99
cmake: pass DO_COVERAGE=1 in env for tests/run.sh (#2575)
`$DO_COVERAGE` is used in tests/run.sh, and should be set with the
`DO_COVERAGE` CMake option.
2019-01-11 17:04:23 +01:00
Daniel Hahler 5dbb5b4992 tests/run.sh: fix handling of test args
Fixes `tests/run.sh tests/test-signal.lua`.
2019-01-03 13:54:37 +01:00
Emmanuel Lepage Vallee 89867386c5 tests: Add images to the tooltip documentation
It also add some properties such as `border_width`, `border_color`
and `preferred_alignments`.

It also fix a documentation bug where the `margin_topleft` was called
`margins_topleft`. To conform to the documentation, both are now valid
but one should be removed the next time the API changes.

Fixes #1978
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee d8a7782bf4 tests: Add an awful.placement.next_to test
It was overdue
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee c3302c4bbe tests: Improve the awful example template
* Support async operations
 * Support `awful.popup`
 * Support minimized clients
2018-12-24 21:49:52 -05:00
Emmanuel Lepage Vallee 90342b62c6 shims: Make sure the wibox boolean properties are set
Also make some changes to support tooltips.
2018-12-24 21:49:52 -05:00
Sergey Vlasov d17433f6c9 tests: Add test for Motif titlebar hints
Test the c.requests_no_titlebar and titlebars_enabled=function...
features.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-11-12 11:48:59 +03:00
Emmanuel Lepage Vallée 2458f127f3
Merge pull request #2360 from Elv13/add_awful_tag_layouts
awful.tag: Add awful tag layouts
2018-10-22 14:40:16 -04:00
Emmanuel Lepage Vallee fded6acf97 tests: Fix a race condition in the spawn test.
To happen, both of these races have to be lost by client3

 * client2 have to take more time to `:kill()` than client3 take
   to be spawned.
 * client4 have to start faster than client3

It is very unlikely to happen on normal systems, but on server it
happens. Some factor that may or may not be involved

 * The scheduler assigned client2 on a very busy CPU and client 3
   on a CPU still busy while some other CPUs are idle
 * Linux is bad at scheduling hyper-threading
 * The system is NUMA and the memory bandwidth is lacking on a core
 * There is some "Z" memory compression or drive based swap
 * Extreme bad luck

Fix #2424
2018-10-16 12:35:18 -04:00
Emmanuel Lepage Vallée 35130169c9
keygrabber: Rename release_event to stop_event (#2422)
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.

The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
2018-10-16 08:42:56 -04:00
Emmanuel Lepage Vallee 23c122e89a tests: Test awful.tag.object.set_layouts 2018-10-15 16:10:18 -04:00
mergify[bot] 7020a9707f
Merge pull request #2421 from Elv13/fix_2419
Fix 2419
2018-10-08 16:46:46 +00:00
Emmanuel Lepage Vallee 6229783e16 tests: Add a titlebar integration suite
It doesn't do all that much, but will prevent #2419 from regressing
2018-10-06 18:57:27 -04:00
Emmanuel Lepage Vallee 4c7bcf044c tests: Add more spawn tests 2018-10-05 10:57:55 -04:00
Emmanuel Lepage Vallee 0ac99a5dc5 awful.rules: Rename switchtotag to switch_to_tags.
First of all, it select many tags, so there is an "s". Also, Awesome
standardised naming to snake case in v4.0, but this was missed.
2018-10-04 09:16:00 -04:00
Sergey Vlasov 16b5803fda Add a test for awful.placement.no_overlap+awful.placement.no_offscreen
Test that the placement function used in the default configuration
behaves as intended.  This test was failing before the no_overlap and
no_offscreen fixes in two previous commits.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov 61cdc40595 awful.placement: Fix no_offscreen when composed with other functions
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken.  The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.

All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.

This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov 7f11bc1108 tests: Add initial size support to the test client
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-12 08:20:53 +03:00
Sergey Vlasov 0e3979b8e4 tests: Fix resize width/height mixup in the test client
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-12 08:15:38 +03:00
Uli Schlachter 0275d3537d Fix no_offscreen test
Commit fec8d6aa8f fixes awful.placement.no_offscreen to behave
like other placement functions. This means that the margins=40 argument
that this test used and that was previously was just ignored, now
started working. Thus, there are now 40 pixels less on each side of the
client in this test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 13:35:09 +02:00
Uli Schlachter 674cd21b81 Merge branch 'second-try-no-offcreen' of https://github.com/actionless/awesome 2018-08-22 12:26:05 +02:00
Uli Schlachter a996b21ee2 test-gravity.c: Accept different roundings
Some window gravities require a division by two. Up to now,
test-gravity.c expected this division to always be rounded up. This
commit changes the code to also allow rounding down.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 11:48:49 +02:00
Uli Schlachter 3aefce7ccb Merge branch 'example_tests_during_build_again' of https://github.com/psychon/awesome 2018-08-08 15:53:32 +02:00
Emmanuel Lepage Vallee a961c5f002 tests: Add keygrabber tests. 2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee e05222088a tests: Add fake_input tests 2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee 0765772c17 shims: Fix a typo in a root.fake_input name 2018-08-06 18:34:40 -04:00
Emmanuel Lepage Vallee a32d892988 tests: Add ways to input fake strings and keybindings.
This commit add a way for the test to avoid all the boiler-plate code
necessary to perform higher level input emulation.
2018-08-06 18:34:40 -04:00
mergify[bot] 1cb8375261
Merge pull request #2340 from psychon/print_log_on_awesome_client_failures
tests/run.sh: Print log on awesome-client failures
2018-08-06 18:06:47 +00:00
Uli Schlachter 2769bdbc5b tests/examples: Run example-tests in build phase, not configure phase
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 16:50:46 +02:00
Uli Schlachter be728324ef tests/examples: Change ENV handling
Instead of messing with CMake's environment and having that implicitly
inherited when running a process, explicitly set $SOURCE_DIRECTORY where
required.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 16:50:46 +02:00
Uli Schlachter 0e94f8bd6b tests/run.sh: Print log on awesome-client failures
tests/run.sh uses awesome-client to actually make awesome run the test.
If awesome-client fails, then the only error message that is printed look like:

== Running /home/travis/build/awesomeWM/awesome/tests/test-leaks.lua ==
Error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
E: dbus-send failed.
make[4]: *** [CMakeFiles/check-integration] Error 1

To also get the output from awesome, this commit makes failures from
awesome-client non-fatal so that the following shell code can notice the
failure and hopefully print some useful information.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 16:03:17 +02:00
Emmanuel Lepage Vallée e889caba91
build: Auto-add example tests outputs. (#2339)
This commit allow the file to be auto added when it doesn't exist. This
save the useless process of writing it by hand.
2018-08-06 09:30:59 -04:00
Uli Schlachter 73b519d38b Fix STRICT_TESTS (#2338)
STRICT_TESTS was introduced in commit c22b93963. Some people have setups
where e.g. fontconfig produces warnings. These warnings made the tests
under tests/examples/ fail. The above commit changes things so that
these warnings are ignored by default, unless STRICT_TESTS is enabled.

Commit b5ca8bf937 broke this by making example test failures fatal
again.

Fix this by appending "|| true" to the command to run in case strict
tests are disabled. Thus, all failures from tests/examples/runner.sh get
ignored.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 09:05:51 -04:00
Emmanuel Lepage Vallée dd7161ee0a
build: Fix a regression when adding new example tests. (#2337)
If the example had a text output, it would cause an error

Regression from b5ca8bf93
2018-08-06 09:05:31 -04:00
Uli Schlachter 15a508f022 Merge branch 'examples_tests_during_build' of https://github.com/psychon/awesome 2018-08-03 14:30:25 +02:00
Uli Schlachter 477af1b145 test runner: Move running to a shell script
Instead of running the example tests directly from CMake and checking
the results via CMake, the tests are now run through a shell script.

So far, there are too many variables involved for me to easily figure
out how to run this shell script in the building phase instead of the
configuring phase, but at least this commit moves the "actual running"
out of CMake, bringing us a step closer to that goal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-31 17:50:41 +02:00
Emmanuel Lepage Vallee 6240ec113f tests: Implement keybindings, keygrabber and fake_inputs 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 3adad38c0a tests: Make the capi.screen shim more robust
Also add some private properties to be consumed by the template for a
better rendered documentation example image.
2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 2c8c274193 tests: Add the capi.object miss handle support to the capi.mouse shim 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 1df44210c8 tests: Add many missing client properties so the tilebar loads correctly 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee ff9f78ef7e tests: Add the cursor and focus colors to the generated images theme. 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee bf6ab0ba4c tests: Mock the keyboard layout API enough to stop getting errors.
It IS NOT correct, the point is to be able to load the keyboard widget
with errors.
2018-07-29 10:46:24 -04:00
Emmanuel Lepage Vallee f1245f083c tests: Add a basic `key` shim 2018-07-29 10:45:40 -04:00
Uli Schlachter b5ca8bf937 example tests: Save expected test output in a txt file
This commit adds a .txt file next to each example test that generates a
text output. This text file contains the expected output and it is an
error if the actual output does not match the expected output. This
means that we no longer have to run the example tests before we can
expand all the @foo@ expressions that occur.

While touching this, I also fixed some typos and unexpected newlines in
the tests' output.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-27 08:56:18 +02:00
mergify[bot] e7251011ac
Merge pull request #2314 from Elv13/add_example_generator_options
Add example generator options
2018-07-25 07:15:18 +00:00
Emmanuel Lepage Vallee 4e8d907044 tests: Restore support for newlines in examples
Since last year luacheck change, trailing spaces are no longer
allowed. This caused all documentaiton examples that used them
as a way to mark newlines to look plain wrong.

This commit add an explicit flag to make longer examples more
readable.
2018-07-24 17:22:41 -04:00
Emmanuel Lepage Vallee c340c14cf2 tests: Improve the CMakeLists.txt
* Add a FOLLOW_SYMLINKS so Awesome 3rd party module can share the
  awesome test infrastructure by adding themselves as symlinks in
  `lib/`, `tests/` and `tests/examples` and otherwise use AwesomeWM
  Travis config.

* Add an option to add examples to the C documentation. Previously only
  Lua functions could be documented using this framework.
2018-07-24 17:22:41 -04:00
Uli Schlachter e1a90ecf5b tests/examples: Explicitly mark tests generating text
This is similar to the previous commit, but for text output that is
produced by some test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 14:27:41 +02:00
Uli Schlachter 654eecd40d tests/examples: Explicitly mark tests generating an image
This allows to figure out if a test will generate an image without
having to run it. The long term plan for this is to run the tests during
compiling ("make") and not during configuring ("cmake"). Since the list
of files to e.g. install needs to be known during configuring, this
commit is a necessary step in that direction.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 14:12:44 +02:00