diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-10-14 11:46:38 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-11-05 19:44:15 +0100 |
commit | 4eaeaf92c8785f34f8ac35715fb386e09b85c37e (patch) | |
tree | 43159aae91ed7d23d9b990c3404ae051bb772021 | |
parent | 2c94026f7f36ec7da94279a94ecf1f555f3994c6 (diff) |
tests: Add env variable to disable code coverage collection
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | public_html/index.php | 2 | ||||
-rwxr-xr-x | run-tests.sh | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/public_html/index.php b/public_html/index.php index 6d81b244c..37526d903 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -230,7 +230,7 @@ function guidv4() $testname = null; -if (getenv("ENVIRONMENT") === "testsuite") { +if (getenv("ENVIRONMENT") === "testsuite" && getenv("COLLECT_COVERAGE") == 1) { if (function_exists("phpdbg_get_executable")) { $testname = implode(' ', $argv); } elseif (isset($_SERVER["HTTP_X_TESTSUITE_TESTNAME"])) { diff --git a/run-tests.sh b/run-tests.sh index a83e8ea25..a65800fb0 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -4,6 +4,7 @@ # export ENVIRONMENT="testsuite" +export COLLECT_COVERAGE=1 startdir="$(dirname "$0")" @@ -37,6 +38,8 @@ phpdbg -qrr index.php tools update_database || exit 1 prove --ext .php --state=failed,save --timer --comments --exec 'phpdbg -qrr index.php tools test' --recurse "${@:-application/test/tests/}" || exit 1 -php index.php tools generate_coverage_report -rm -rf test-coverage-data +if (($COLLECT_COVERAGE)); then + php index.php tools generate_coverage_report + rm -rf test-coverage-data +fi |