Commit Graph

217 Commits

Author SHA1 Message Date
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 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
Bernhard M. Wiedemann 24fa4ba6a3 dont add timestamps to created images
This allows for reproducible builds
2016-03-20 16:22:52 +01:00
Emmanuel Lepage Vallee b6871833c4 cmake: Generate gears.shape SVG and example code 2016-03-16 18:02:41 -04:00
Daniel Hahler e19f73c6bf Merge pull request #79 from akdor1154/versioningFix
Implement basic DEB/RPM packaging
2016-03-15 00:23:51 +01:00
Jarrad Whitaker 0283bab54f implement basic DEB packaging 2016-02-28 20:07:54 +11:00
Uli Schlachter 43dba09c28 Add& use Luacheck support
This commit adds a new "luacheck" target to the Makefiles. This target is
automatically included in "make check" when luacheck is found in $PATH.
Additionally, this includes luacheck in Travis so that the build fails when
luacheck complains about something.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-16 19:45:10 +01:00
Uli Schlachter 1ea3ba6f30 Merge branch 'fix-images-in-doc' of https://github.com/awesomeWM/awesome 2016-02-14 14:33:51 +01:00
Uli Schlachter 3bc8aa2d40 Fix images in the documentation
Instead of copying images to ${BUILD_DIR}/docs/images, which is the directory
with the input to ldoc, this now copies the images to ${BUILD_DIR}/doc/images,
which is where ldoc generates its output. That way, the images are together with
the html files and are automatically picked up by a lot of stuff.

Fixes: https://github.com/awesomeWM/awesome/issues/681
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-13 08:04:14 +01:00
Uli Schlachter b823dd4ed4 Add code coverage support
This uses coveralls.io and integrates the collection of coverage information
with Travis.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:26:07 +01:00
Emmanuel Lepage Vallee d59bdec32f Fix make install when documentation is disabled 2016-02-11 03:43:19 -05:00
Emmanuel Lepage Vallee 3ef5003ace doc: Add support for images 2016-02-10 01:09:50 -05:00
Uli Schlachter 4c8128eaa9 Make errors from LDoc fatal
Via this commit, any warnings from LDoc are fatal and make "make" fail. The
intention is to cause failures on Travis for PRs that introduce broken
documentation.

Closes: https://github.com/awesomeWM/awesome/issues/643

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-30 10:43:58 +01:00
Kazunobu Kuriyama 998a20514a Modify CFLAGS handling
- Remove `-rdynamic` from "CFLAGS" and count on CMake to pass it to
   the compiler at the link phase (Issue #450).
 - Move the definition of "CFLAGS" from `awesomeConfig.cmake` to
   `CMakeLists.txt` and give it a name, `AWESOME_C_FLAGS`, so that the
   relation between the target and the flags is made clearer and
   manageable.
 - Make `AWESOME_C_FLAGS` a cached variable so that the developers can
   tweak the flags promptly in accordance with their necessities without
   changing the prescribed value.
 - Add a logic to cope with the case where CMake fails to set
   `-rdynamic`.

Closes https://github.com/awesomeWM/awesome/pull/453.
2015-09-19 12:02:03 +02:00
Daniel Hahler 87ee480853 CMakeLists.txt: a_icon_convert: skip existing sources
Fixes: https://github.com/awesomeWM/awesome/pull/215#issuecomment-103185810.
2015-08-02 15:22:37 +02:00
Uli Schlachter b75f374d9c Fix sporadic test failure due to lgi
With version 2.0rc5, Busted started cleaning up between tests more thoroughly.
The result was that it managed to unload and reload lgi. However, the C part of
lgi is not safe to be reloaded. This caused sporadic errors in the test suite
runs.

Work around this via a helper script that is run before Busted starts running
tests. When we load lgi in this helper script, it is loaded before Busted starts
saving and restoring everything and thus lgi won't ever be unloaded.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-29 21:31:47 +02:00
Uli Schlachter 4de435dd54 CMakeLists.txt: Add COMMENTs to both check targets
These are printed by CMake when starting these targets.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-26 00:40:48 +02:00
Uli Schlachter c1ea77dab1 Add integration tests to 'make check'
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-26 00:40:48 +02:00
Uli Schlachter 8a628bed7e CMakeLists.txt: Remove "test" target
This gets rid of the following CMake warning:

CMake Warning (dev) at CMakeLists.txt:341 (add_custom_target):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-26 00:40:48 +02:00
actionless cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Daniel Hahler 32b584258b CMakeLists.txt: fix installation of themes
Install *.lua from ${BUILD_DIR}/themes.
2015-06-22 13:26:36 +02:00
Julian Wollrath 26f15a13f3 Document C API directly in the C source code
v2: Add available signals to the docs.

Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-06-19 23:13:31 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00
Julian Wollrath 130504a3d0 Rip out useless Doxygen support
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:31:13 +02:00
Heiko Becker b0d4f4eb0e Use version agnostic FindLua from cmake-3.0.0 2015-06-19 22:31:13 +02:00
Peter Junos 19137a55c3 Support for XKB - changing keyboard layouts
This commit adds support for writing in prompt (<Super>+R by default)
while different keymap is selected

Signed-off-by: Peter Júnoš <petoju@gmail.com>
2015-05-28 23:20:17 +02:00
Aleksey Fedotov 996f6785a8 xkb: implementation of keyboard layout switched
This patch provides functions to get/set current keyboard layout.

Current implementation doesn't support any configuration of layout,
it's a merely a layout indicator and switcher, however layout
configuration can be set by tools like setxkbmap or by any third-party
tools.
2015-03-03 00:33:16 +03:00
Ignas Anikevicius (gns_ank) b96b3ef31c Docs: Move all docs to a `docs` folder.
This moves all of the documentation into a separate folder, which keeps
everything in one place and avoids unnecessary clutter.

This will pay off when proper guides are written for various aspects of
using awesome or contributing to it.

This also updates the building system, so that the docs are properly
generated with new directories.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Uli Schlachter 94e61ec94b timer: Move from C to lua as gears.timer
No API-change (besides the obvious no-longer-a-global-object) intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 16:44:04 +01:00
Uli Schlachter ba50e65b5b Add unit tests
This uses busted (http://olivinelabs.com/busted/) to implement unit testing.
This is wired up to "make check" and/or "make test".

This commit also adds tests for the more complicated parts of the gears and
wibox.layout libraries.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-23 22:09:06 +02:00
Uli Schlachter fa9c7c139b Add a lost comment to CMakeLists.txt
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-23 17:23:03 +02:00
Emmanuel Lepage Vallee 302aabea3a Rename README -> README.md in CMakeLists.txt 2014-04-10 01:56:18 -04:00
Uli Schlachter d8b73de739 screen.[ch]: Move into objects/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 15:12:47 +02:00
Uli Schlachter 574811d270 CMake: Check for the needed lgi dependency
We only need lgi for running, not for building. This means that our lgi
dependency is easily missed. This commit makes this dependency more explicit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-25 19:43:09 +01:00
Uli Schlachter c87e775e46 Use LDoc instead of Luadoc (FS#1006)
Since we are no longer using module(), luadoc no longer understands our modules.
With this commit we use LDoc instead which seems more modern.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 14:57:47 +01:00