Commit Graph

200 Commits

Author SHA1 Message Date
Uli Schlachter b5abd53cbf Use reproducible timestamps in more doc examples (#2626)
This adds require("_date") to some example tests that use the current
date via os.date. This allows reproducibility by replacing os.date()
with a function that uses a static date from $SOURCE_DATE_EPOCH. See
commit 9d7eaf0 for more details.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-29 19:36:40 +01:00
mergify[bot] cdd6e360f5
Merge pull request #2609 from psychon/shape_outside
Change the way the shape is done in the background container
2019-01-29 18:21:24 +00:00
Uli Schlachter 84eb175ccd background container: Deprecate shape_clip property
The previous commit removed the implementation of this property.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-28 14:55:53 +01:00
Emmanuel Lepage Vallee 4524a7880d tests: Test the layoutlist 2019-01-26 01:34:59 -05:00
Emmanuel Lepage Vallée 7e7733c6d1
Merge pull request #2521 from Elv13/modifiers
awesome: Add a `modifiers` field.
2019-01-24 23:59:54 -05:00
Emmanuel Lepage Vallee 6c1f9ec651 tests: Test the awful.popup 2019-01-24 10:58:45 -05:00
Emmanuel Lepage Vallee 94937595c2 doc: Use the modifier name instead of the keysym for the alttab example 2019-01-21 03:14:26 -05:00
Emmanuel Lepage Vallee b466db955f shims: Add awesome._modifiers 2019-01-21 03:13:26 -05: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
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
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
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 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
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
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
Uli Schlachter efe23dc7d2 tests/examples: Drop support for PNG output images
No currently existing test produces a PNG image, so why do we even check
for such an output file?

I did 'rm -rf build && make -j9 && cp -r build /tmp', then applied this
patch, and then did another 'rm -rf build && make -j9'. According to
diff, the resulting directories are basically the same (except for lots
of timestamps and some non-determinism in CMake).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 13:49:43 +02:00
actionless fec8d6aa8f fix(awful: placement: no_offsceen): use new placement infrastructure
fix(tests: examples: awful: placement: no_offscreen): uncomment context

fix(awful: placement): common function to remove border from geometries
2018-07-24 07:38:35 +02:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00
Uli Schlachter c8d6b7d28a Use get_cache_dir() where appropriate
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-11 16:08:07 +01:00
Emmanuel Lepage Vallée aabff6dac7
Merge pull request #1487 from Elv13/fix_1482
Add an awful.rules chain of responsibility
2018-03-04 16:42:05 -05:00
Emmanuel Lepage Vallee 6921dc9f4c doc: Add a titlebar example 2018-03-04 02:21:48 -05:00
Emmanuel Lepage Vallee 20db37f892 tests: Test the gears.sort module 2018-03-04 01:34:33 -05:00
Emmanuel Lepage Vallee cfaf7d8fe8 titlebar: Expose some previously private properties.
I am not happy with this API in general, I keep it undocumented
for now. In a perfect world, the whole client frame would be
a hierarchy.
2018-02-25 18:01:08 -05:00
Emmanuel Lepage Vallee 45135b28b1 shims: Use cairo PNG support instead of GDK
It is inferior, but at least doesn't print warnings on Travis due
to the lack of X server.
2018-02-25 18:01:08 -05:00