From 9e05ff63ce99145cd1215732de86e6c9c1b568b0 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 6 Feb 2016 17:18:23 +0100 Subject: [PATCH] Code coverage: Also consider functional tests Lots of our code depends on the C API and thus can only be tested when that is available. Hence, it makes sense to also run the functional tests under LuaCov. Signed-off-by: Uli Schlachter --- .luacov | 4 ++++ .travis.yml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.luacov b/.luacov index b236077e..5f7f3eb7 100644 --- a/.luacov +++ b/.luacov @@ -13,6 +13,10 @@ return { include = { escape_pattern(lib_dir) .. ".+", + + -- For things already having the correct path + -- (happens with integration tests) + "^lib/", }, -- configuration for luacov-coveralls reporter diff --git a/.travis.yml b/.travis.yml index 01d5c1e5..de5484bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,7 +83,12 @@ install: script: - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION" - make && sudo env PATH=$PATH make install && awesome --version && make check - - if [ "$DO_COVERAGE" = "true" ]; then make check-coverage; fi + - | + if [ "$DO_COVERAGE" = "true" ]; then + make check-coverage || exit 1; + sed -i "1 i\\require('luacov.runner')('"$PWD"/.luacov')" build/awesomerc.lua || exit 1 + BUILD_DIRECTORY="" tests/run.sh || exit 1 + fi after_success: # Push updated API docs for relevant branches, e.g. non-PRs builds on master.