Commit Graph

250 Commits

Author SHA1 Message Date
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
Uli Schlachter 56d4cdfa32 CMake: Automatically collect generated doc files
Instead of hardcoding the list of generated doc files as dependencies to
ldoc, we jump through some hoops to compute this dynamically.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-22 11:22:16 +02:00
Uli Schlachter 4f1897b256 Ignore warnings from ldoc by default
A while ago, we made errors from ldoc fatal by default. Then a new ldoc
release appeared and caused problems for all of our users, because
awesome failed to work.

This patch reverts the previous fix so that we ignore ldoc warnings by
default again. However, to catch ldoc warnings on Travis, another
ldoc-building-target is added that fails on warnings. This new target is
included in our "check" target.

This fixes the intend of issue #1098 ("Users with ldoc version X cannot
build awesome"), but it does not actually employ the solution proposed
there ("Blacklist those ldoc versions"). Still, since this fixes the
intend of the issue, I count it as fixed.

Fixes: https://github.com/awesomeWM/awesome/issues/1098
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-22 11:03:56 +02:00
Emmanuel Lepage Vallee dd959eecd6 build: Fix make install when ldoc is missing 2016-10-03 23:39:14 -04:00
Emmanuel Lepage Vallee 63b712e247 doc: Document rc.lua
This meta-lua script takes the "raw" awesomerc.lua and turn it
into the final file and generate a documentation page from its
parsed content. It support

 * Turn {{{ into markdown categories
 * Turn top level comments into documentation
 * Add custom documentation sections
 * Parse the code to add links for each API calls

This helps generate a good entry point for new users wanting to
understand the content of rc.lua without searching the API by
hand.

Over time, this will also become the basis of the documentation.

If `rc.lua` is separated into several files, this will be easy to fix
this script. It could even do the separation itself from a monolitic
file using the already implemented {{{ parser.
2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 5f10e7a74e doc: Begin to document the themes better.
This add a meta-lua file that parses all existing lua files
to generate a list of all beautiful variables.
2016-09-26 00:40:19 -04:00
Uli Schlachter 7ea816045d "make check": Support out-of-tree builds
Currently, tests/run.sh expects the directory layout that our wrapper Makefile
sets up before running CMake. This commit adds support for any other directory
configuration as well.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 18:52:18 +02:00
Uli Schlachter 96370e32a3 Use a_find_program() instead of find_program()
a_find_program() prints some status, making it easier to see what was found and
was not.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 16:10:18 +02:00
Emmanuel Lepage Vallee af6586a723 build: Be more careful about the use of .. 2016-04-14 21:31:19 -04:00