From 40e25ef65331dc47f0112a7c7e81c5684fc2c0eb Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 23 Nov 2018 17:28:34 +0100 Subject: [PATCH] coverage.sh: only run cover if coverage data exists This is useful if ./coverage.sh is run with CMD=./mmdebstrap and thus gathering coverage data is disabled. --- coverage.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/coverage.sh b/coverage.sh index c056199..e77ca46 100755 --- a/coverage.sh +++ b/coverage.sh @@ -597,15 +597,17 @@ done guestfish add-ro shared/cover_db.img : run : mount /dev/sda / : tar-out / - \ | tar -C shared/cover_db --extract -cover -nogcov -report html_basic shared/cover_db -mkdir -p report -for f in common.js coverage.html cover.css css.js mmdebstrap--branch.html mmdebstrap--condition.html mmdebstrap.html mmdebstrap--subroutine.html standardista-table-sorting.js; do - cp -a shared/cover_db/$f report -done -cover -delete shared/cover_db +if [ -e shared/cover_db/runs ]; then + cover -nogcov -report html_basic shared/cover_db + mkdir -p report + for f in common.js coverage.html cover.css css.js mmdebstrap--branch.html mmdebstrap--condition.html mmdebstrap.html mmdebstrap--subroutine.html standardista-table-sorting.js; do + cp -a shared/cover_db/$f report + done + cover -delete shared/cover_db -echo -echo open file://$(pwd)/report/coverage.html in a browser -echo + echo + echo open file://$(pwd)/report/coverage.html in a browser + echo +fi rm shared/tar1.txt shared/tar2.txt