tests: improve coverage with integration tests (#2082)
- install luacov.runner in tests/_runner.lua. - use Lua's `dofile` to execute the test files, which will give us coverage for them. - CMakeLists.txt: revert DO_COVERAGE env injection - revert cd: make f absolute if not in source_dir
This commit is contained in:
parent
62c0affa53
commit
73ebf452ec
|
@ -213,8 +213,8 @@ script:
|
|||
travis_run_in_fold "make.check-qa" make check-qa
|
||||
fi
|
||||
- |
|
||||
set -e
|
||||
if [ "$TEST_PREV_COMMITS" = 1 ] && ! [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
||||
set -e
|
||||
# Check each commit separately (to make git-bisect less annoying).
|
||||
# Fix Travis' commit range (https://github.com/travis-ci/travis-ci/issues/4596).
|
||||
commit_range="${TRAVIS_COMMIT_RANGE/.../..}"
|
||||
|
|
|
@ -241,9 +241,13 @@ for f in $tests; do
|
|||
continue
|
||||
fi
|
||||
fi
|
||||
# Make the filename absolute if it is not.
|
||||
if [ "$f#/" = "$f" ]; then
|
||||
f="$source_dir/$f"
|
||||
fi
|
||||
|
||||
# Send the test file to awesome.
|
||||
DISPLAY=$D "$AWESOME_CLIENT" 2>&1 < "$f"
|
||||
# Execute the test file in awesome.
|
||||
DISPLAY=$D "$AWESOME_CLIENT" 2>&1 "dofile('$f')"
|
||||
|
||||
# Tail the log and quit, when awesome quits.
|
||||
# Use a single `grep`, otherwise `--line-buffered` would be required.
|
||||
|
|
|
@ -41,5 +41,5 @@ for theme_file in themes/*/theme.lua; do
|
|||
AWESOME_RC_FILE="$config_file" \
|
||||
AWESOME_THEMES_PATH="$build_dir/themes" \
|
||||
AWESOME_ICON_PATH="$PWD/icons" \
|
||||
"$source_dir/tests/run.sh" themes/tests.lua
|
||||
"$source_dir/tests/run.sh" "$source_dir/tests/themes/tests.lua"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue