Commit Graph

258 Commits

Author SHA1 Message Date
Lucas Schwiderski 4d111db7b2 build: Fix a recent regression when tests are built.
Fix #3502
2021-11-13 19:28:12 -08:00
Uli Schlachter 4955ec584f tests: Add a systray program. 2021-10-31 13:36:17 -07:00
Lucas Schwiderski 4d43ccda6d
Rename Lua executable envvar
Use `LUA` based on the traditional naming scheme in Makefiles.
2021-03-23 09:10:07 +01:00
Lucas Schwiderski 6d0eb8660d
Use Lua executable variable for check-integration 2021-03-23 09:10:05 +01:00
Lucas Schwiderski 998b24e544
Use Lua executable variable for check-requires 2021-03-23 09:10:04 +01:00
Emmanuel Lepage Vallee af4b4a254f init: Move the command option parsing to its own file.
The next commit will add modeline support and share the code.
2020-02-04 01:50:02 -05:00
Emmanuel Lepage Vallee 067f8f4ebf tests: Use --screen manual for both code coverage jobs. 2019-09-29 18:56:06 -04:00
Emmanuel Lepage Vallee 6ce4fa6802 doc: Remove the old module alias hack.
The module names for also have their alias. The commit also remove 2
deprecated module that were forgotton in the previous "get rid of the
deprecated modules in the doc" PR.
2019-06-08 18:13:42 -04:00
Uli Schlachter b979fb724a Start a selection transfer object
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-11 09:21:43 +01:00
Uli Schlachter 94d413345a Prepare a selection acquiring interface
No run-time behaviour is changed so far.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-11 09:01:21 +01:00
mergify[bot] ec47abb4bc
Merge pull request #2639 from psychon/selection_get
Add selection getter objects
2019-02-11 04:00:59 +00:00
Uli Schlachter e17912ec0c Prepare a selection getter interface
This prepares a new class for getting selection contents. No run-time
behaviour changes yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-07 15:16:48 +01:00
Uli Schlachter 0295df81c1 Prepare a selection watcher interface
This commit adds the necessary method calls to setup the class and also
so that xfixes selection notify events can be handled. Currently, these
are empty functions, but later commits will fill them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 09:30:16 +01: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 d00d3d4702
cmake: improve check target(s) deps (#2571)
* cmake: use add_custom_target/add_dependencies instead of CHECK_TARGETS

This makes it fail in case of errors explicitly.  Previously appending
to CHECK_TARGETS in tests/examples/CMakeLists.txt was silently ignored.

* cmake: check: depend on check-unit always

Without busted this will print a message only, but that is good to have.
(I was confused why "check" would not depend on "check-unit" when
looking at the generated Makefile (which was caused due to some luarocks
environment being active without busted))
2019-01-11 17:03:32 +01:00
Daniel Hahler ac34a687c0
cmake: clarify comment for check-unit with not found busted (#2566) 2019-01-10 19:09:40 +01:00
Daniel Hahler b392e2ce74
cmake: remove check-unit-coverage (#2568)
Just configure `check-unit` to use `--coverage` with `busted` with
`DO_COVERAGE=1`.

I got confused why `check-unit` would not generate coverage.
This keeps it in line with other targets that generate coverage when
used with the same name.
2019-01-10 13:30:58 +01:00
mergify[bot] e647166ad6
Merge pull request #2546 from blueyed/man
Fix warning with de man page
2019-01-05 03:51:41 +00:00
Daniel Hahler 6792415cef ldoc: prepare for custom ldoc.ltp
ldoc.ltp is copied from ldoc (ldoc/html/ldoc_ltp.lua).
2019-01-04 22:39:28 +01:00
Daniel Hahler 6be0f39454 cmake: man: use txtfile directly
This helps with warnings:

> [ 94%] Generating manpages/de/man1/awesome.1
> asciidoctor: WARNING: awesome.1.de.txt: line 10: unterminated listing block
> [ 94%] Generating manpages/de/man1/awesome.1.gz
> …
> [ 98%] Built target man
2019-01-04 16:15:44 +01:00
Emmanuel Lepage Vallee 6ac8f30d62 build: Add more dependencies to the ldoc target
Right now it was possible to modify `rc.lua` without the doc being
aware of it.
2018-10-12 14:03:33 -04:00
Joseph Herlant d9cc56538f build: man pages: use asciidoctor instead of asciidoc (#2234) 2018-04-04 11:28:50 +02:00
Kevin Zander 80b21cfbc3 Fix manpage warnings during build (#2161)
Fixes #1392
2018-01-21 21:20:33 -05:00
Daniel Hahler b291880fa1 add css
Source: https://github.com/stevedonovan/LDoc/pull/287
https://raw.githubusercontent.com/hishamhm/LDoc/7214818f0ff580e5607a4de764340aa7e3b55d1a/ldoc/html/ldoc_new_css.lua
2017-10-28 00:08:28 +02:00
Daniel Hahler 65b6d12b44 Merge pull request #2073 from blueyed/fix-examples
tests: examples: remove caching, add depends for ldoc
2017-10-27 00:21:55 +02:00
Daniel Hahler 579159a8cc CMakeLists.txt: check-integration: depend on main target (#2081)
This makes `make check-integration DO_COVERAGE=1` on a clean build work.
2017-10-24 20:59:51 +02:00
Daniel Hahler 1ab861ea3a tests: busted: add config file, use --verbose by default (#2076) 2017-10-22 18:05:00 +02:00
Daniel Hahler 386e74b852 CMakeLists.txt: ldoc: depend on generate-examples 2017-10-22 15:55:50 +02:00
Daniel Hahler 790a669029 cmake: add strict mode for ldoc, based on STRICT_TESTS (#2035)
This allows for building the docs with an older ldoc version, and it
makes sense in general to make warnings not fatal by default.

Ref: https://github.com/awesomeWM/awesome/pull/2027#issuecomment-328354095
2017-09-11 14:20:43 +02:00
Daniel Hahler 2c741f8e1d build: use --fatalwarnings with ldoc, remove check-ldoc-warnings (#1963)
Instead of having a custom target with redirection magic, just use
`--fatalwarnings` with ldoc.  This requires ldoc 1.4.5.
2017-08-16 19:23:10 +02:00
Daniel Hahler ef04fa688e tests/themes/run.sh: use themes from source dir (#1994)
This makes it easier to track their coverage.
2017-08-16 13:27:49 +02:00
Daniel Hahler e9adb28af6 Merge pull request #1973 from blueyed/tests-error-on-warnings
Tests: check-integration: error on warnings
2017-08-15 17:59:30 +02:00
Daniel Hahler 934ad741a7 tests: keep check-themes separate from check-integration (#1991)
Ref: https://github.com/awesomeWM/awesome/pull/1973#issuecomment-322183782
2017-08-14 17:18:46 +02:00
Daniel Hahler f8d1e46eaa CMakeLists.txt: pass TEST_RUN_ARGS to tests/run.sh, default to -W 2017-08-14 16:00:35 +02:00
Daniel Hahler 730b706217 check-integration: fail on warnings
Those are most likely deprecation warnings, but the tests should be free
of warnings (from awesome) anyway.

The "Last main loop iteration took X seconds!" warning is filtered out.
2017-08-14 13:42:13 +02:00
Emmanuel Lepage Vallée 2900ea6f01 Merge pull request #1842 from psychon/lgi-check
Port lgi-check.sh to C
2017-08-12 15:59:18 -04:00
Daniel Hahler f698a17138 Add check-themes, which tests themes via tests/themes/
It relies on tests/run.sh to handle failures.
2017-08-11 20:01:37 +02:00
Daniel Hahler 56ac221544 CMakeLists.txt: copy all icons to build dir 2017-08-10 21:57:59 +02:00
Daniel Hahler fc1ba35366 CMake: only run ldoc with changed input (#1911)
This adds a custom command to build the documentation, where you can
specify the generated output then. "ldoc" then depends on this output.

This way "ldoc" is not being run every time, but only if the input files
have changed.  ldoc's config is added therefore to the list of
dependencies to make config changes trigger a rebuild.
2017-07-09 18:45:14 +02:00
Uli Schlachter 95b412df19 Move project() call to CMakeLists.txt (#1909)
CMake "fakes" a call to "project(Project C CXX)" if it does not see a
project() call in CMakeLists.txt. Since we had this call in a different
file, this default applied. This meant that CMake unnecessarily required
a C++ compiler.

Fix/work-around this by moving the call to project() into CMakeLists.txt

Reference: https://github.com/awesomeWM/awesome/pull/1907#discussion_r125581273
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 16:23:56 +02:00
Daniel Hahler 09bffcd432 cmake: define check-unit always (#1896)
Fixes https://github.com/awesomeWM/awesome/issues/1891.
2017-07-01 22:32:14 +02:00
Daniel Hahler 731099ba4d CMakeLists.txt: remove check-unit from ALL (#1867)
This makes "make install" not run the unit tests (again).

Instead "check-unit" is added to the top-level wrapper Makefile to be
run for its "all" task.
2017-06-25 20:04:32 +02:00
Uli Schlachter ddc51cf38c Port lgi-check.sh to C
Previously, the lgi check used the normal Lua interpreter to check if
lgi is installed. However, nothing ensures/requires that awesome is
built against the same Lua version as the Lua interpreter. This means
that if lgi is only available for some Lua version, then the check could
succeed even though awesome would later fail to start. Also, the check
might have failed even though awesome would not have any problems
finding lgi.

This commit replaces lgi-check.sh by a small C program which does the
same thing. This ensures that the same Lua version is used as awesome
will be using.

There are some places that still use the Lua interpreter: Example tests
(run through the Lua interpreter directly) and unit tests (run through
busted). For unit tests, this should not make much of a difference and
example tests might later get similar treatment.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-13 15:47:07 +02:00
Uli Schlachter 27eba6c034 Abort on in-source-builds (#1788)
They do not work since we overwrite things in such a way that the build
will fail.

Fixes: https://github.com/awesomeWM/awesome/issues/1786
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-24 21:06:27 +02:00
Uli Schlachter 3ed0be6d85 Add a test for gravity handling (#1760)
This adds a C program which tests if the window manager handles
gravities correctly. This program is loosely based on metacity's
test-gravity.c, but completely rewritten and this version does automatic
tests instead of allowing the user to perform testing by hand.

By having this as a self-contained C program, it is possible to compare
awesome's behaviour with the behaviour of other WMs.

In my testing, only metacity and awesome pass this test. This is not
that much of a big surprise since awesome was fixed in
https://github.com/awesomeWM/awesome/pull/505 to work correctly with
metacity's test-gravity.c. However, I am surprised that e.g. Fluxbox
gets this wrong.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:28:45 +02:00
Uli Schlachter 0afed66ccf Add a utility checking uses of require()s
Currently, "everything can require everything". It's an unstructured
mess which sometimes causes problems.

This commit adds a tool that enforces a white-list of require() uses. It
uses depgraph to scan the source code and then each use of require()
that is found is checked. If any violations are found, the tool returns
a failure.

This tool is wired up to a new target "make check-requires" which is
included in "make check". Thus, Travis will run this.

Reference: https://github.com/awesomeWM/awesome/issues/1400
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-08 08:35:43 +01:00
Uli Schlachter b9b59be816 CMakeLists.txt: Inline some once-used variables
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-26 15:17:21 +01:00
Daniel Hahler 061c434a90 CMakeLists.txt: use source dir with check-unit/check-unit-coverage
The build files do not get updated on source changes currently anyway
(as a dependency of these targets), and this seems to be a leftover from
when `lua.in` files were used / pre-processing was required?!
2017-01-08 20:34:13 +01:00
Uli Schlachter e2a791ab05 Specify USES_TERMINAL for running tests/run.sh (#1331)
The documentation for CMake's add_custom_command()-command says the
following for USES_TERMINAL:

  The command will be given direct access to the terminal if possible.
  With the ``Ninja`` generator, this places the command in the
  ``console`` ``pool``.

The result is that one can see the progress of tests/run.sh, because
messages appear immediately instead of delayed (instead all other
parallel steps are delayed; in practice this means luacheck output
appears only after tests/run.sh is done).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-30 14:12:54 +01:00
Daniel Hahler 333cd6491f Travis: run luacheck just once (#1230)
This also helps to easier spot failures because of this when looking
at the build matrix.

 - Add new check-qa target, to be run only once.
 - Add explicit check-unit-coverage target, used with DO_COVERAGE.
2016-11-27 15:24:04 +01:00