Commit Graph

26 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 15b025ff91 tests: Add the theme path ENV variable
That way theme assets can be used by the documentation images
2017-10-21 17:50:38 +02:00
Daniel Hahler 02f894ce0c Improve tests/examples: generate deps for output files (#1962)
This still runs all the tests in the configure phase, since the tests
report back what output file (png/svg/none) will be generated.. :/

This could be improved by having this table in CMakeLists directly, or
by having a callback into the tests that only reports back that
information.  The latter would still execute all the tests (via a Lua
process).

Adds an explicit check-examples target.
2017-08-31 21:21:19 +02:00
Daniel Hahler 8923df4a5f build: make DO_COVERAGE a CMake variable
Travis: remove CXXFLAGS (not used), LDFLAGS (typo, not used)

Closes https://github.com/awesomeWM/awesome/pull/2001.
2017-08-29 22:24:12 +02:00
Uli Schlachter d33d7d71d7 tests/examples/CMakeLists.txt: Add a project() call (#1926)
project() automatically sets the PROJECT_NAME variable. Thus, when this
CMake code is run due to being included by awesome, this commit has no
effect.

When this CMake code is run on its own, CMake will no longer check for a
C and C++ compiler.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-17 10:11:52 +02:00
Emmanuel Lepage Vallee f448a604b7 cmake: Add a --DOC_NO_DASH option to the doc examples framework
This way it can be used in documentation pages.
2017-02-12 22:19:08 +01:00
Daniel Hahler eacc49243b tests/examples/CMakeLists.txt: invoke luacov with `lua` directly 2017-01-08 20:34:13 +01:00
Daniel Hahler 6aee6c2053 ci: overhaul coverage processing
- Execute the tests without compiling, and don't mess with the source
   files when coverage is enabled.
   This ensures that the coverage report lines are correct.
   This disables the doc tests, as their results would be unused.
   Hack: it still expands macros on util.lua, because of
   `util.get_themes_dir()` and `util.get_awesome_icon_dir()`, which might
   be moved later.  Ref:
   https://github.com/awesomeWM/awesome/pull/1239#discussion_r93828178.
 - ensure that BUILD_APIDOC and DO_COVERAGE are not used together
 - awesomeConfig.cmake: add DO_COVERAGE as an option
 - Travis: only install codecov with DO_COVERAGE=codecov
 - Travis: do not use set -v; use set -x with DO_COVERAGE
 - do not use trailing slashes with dirs in tests/examples/CMakeLists.txt / .luacov
 - Use latest luacov (0.12.0-1) again
   This reverts parts of 4cc6a815.
   I think it is better to fix any failure that 4cc6a815 tried to work around.
 - Travis: simplify/fix require('luacov') for functionaltests
 - tests/examples/CMakeLists.txt: resolve ../.. in SOURCE_DIR
 - tests/examples/CMakeLists.txt: add DO_COVERAGE to env
 - Cleanup/simplify .luacov: work with SOURCE_DIRECTORY alone
 - tests/run.sh: pass through / set SOURCE_DIRECTORY when running awesome
 - tests/run.sh: resolve source_dir
 - use DO_COVERAGE from env only
2017-01-08 20:34:13 +01:00
Emmanuel Lepage Vallee ad203232c4 cmake: Add an extra space to the @usage code
Otherwise commented lines look like ---- My comment
instead of -- -- My comment. This wasn't a problem before the
intentation fix commit, but it is now.
2017-01-03 00:07:57 -05:00
Uli Schlachter 7d3b7fc48a Add vim modelines to all CMake files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-31 14:02:14 +01:00
Uli Schlachter af59d52ddf Slightly change DOC_HIDE magic
The following commits will add DOC_HIDE uses that are not at the end of
the line, but the beginning. Hence, drop the requirement that it appears
at the end of the line and change the ".+" at the beginning into ".*".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-31 13:58:35 +01:00
Emmanuel Lepage Vallee e01de8d977 tests: Expose the themes to the examples tests 2016-12-11 00:10:39 -05:00
Daniel Hahler 86bc579649 Improve messages with tests/examples/CMakeLists.txt 2016-10-01 17:24:44 +02:00
Daniel Hahler 84e7875e50 minor: fix doc for tests/examples/CMakeLists.txt 2016-10-01 17:24:03 +02:00
Crazy Lemon ffa7519730 Has the example test runner unset env variables that would interfere (#1106)
with using LUA_PATH for the `package.path` default valua for the shim tests
2016-09-20 19:36:23 +02:00
Uli Schlachter c22b939630 Be less strict about warnings from "example tests" (#1045)
The build is no longer aborted when one of the "example tests" produces a
message on stderr. However, on Travis this requirement is still made. This
should catch "bad errors" via Travis while not breaking the build for users.

Fixes: https://github.com/awesomeWM/awesome/issues/821
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-20 18:59:28 +02:00
Uli Schlachter 7488f80be7 tests/example/: Print status messages
Running the tests sadly takes much to long. Since I don't have a good idea what
to do about this (I'd like to run all tests in a single Lua process, but that
doesn't seem to be possible easily), instead let's just make it more explicit
what is being done. This commit prints a message for each test that is being
run.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-11 10:24:34 +02:00
Uli Schlachter ca074dc689 tests/example/: Remove environment hack
Now that tests are no longer scanned for recursively, the hack of passing values
back and forth via the environment is no longer needed and can be removed.

While at it, this also exchanges the "useless use of regex" for an explicit
string replacement.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-11 10:24:34 +02:00
Uli Schlachter a7d6699d5d tests/example/: Replace recursion with iteration
Instead of recursively walking the directory tree, this commit makes the code us
GLOB_RECURSE to find all files and then handles them on after another.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-11 10:24:34 +02:00
Uli Schlachter 77f867ff57 tests/example/: Explcitly compute namespace
The namespace of e.g. "tests/examples/awful/mouse/coords.lua" is "_awful_mouse".
This is purely based on the path of the file.

Previously, this was computed while recursively scanning the directory tree.
This commit instead moves this to an extra function that handles this task.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-11 10:24:34 +02:00
Uli Schlachter 5fb6ca8194 tests/example/: Make search for template.lua explicit
Previously, while recursively scanning the directory tree, the code in here also
scanned for template.lua files and remembered the latest one it found. This
commit adds a function which finds the right template.lua for a given file name,
making this search explicit and easier to understand.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-11 10:24:34 +02:00
Uli Schlachter ffe64727fe Silence warnings in examples (#944)
There was a problem that the examples were considered to have failed as soon as
they produced any kind of output, but there were legitimate cases of warnings
being printed that triggered these checks. Commit 4819be4f4f used a
regular expression to detect and ignore this warnings.

This commit reverts the above commit and instead silences the warnings by
monkey-patching the function that prints the warnings into a no-op.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-07 22:57:01 +02:00
Emmanuel Lepage Vallee ac7ea4c70f tests: Fix coverage data
As the documentation generation insert increasingly large ammount
of code into the lua files, the coverage data is getting less and
less accurate. This try to fix this by only collecting such data
after the `configure_file` calls are done.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee bb0a2addb4 tests: Add an option to disable @usage ldoc tag 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 4819be4f4f build: Do not exit when gears.debug.print_warning are issued 2016-04-03 23:45:56 -04:00
Emmanuel Lepage Vallee 421c10b19a Change autogenerated images name
Github drop files when the leading character is ., ~, # or _

This commit add a prefix in front of the name to avoid leading
underscores.
2016-03-31 23:42:05 -04:00
Emmanuel Lepage Vallee e7652a053d tests: Add a new testing framework 2016-03-31 04:45:45 -04:00