From e6343dda0e6509b37601f37c0eacd4a70e23918e Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Sat, 23 Dec 2023 22:16:31 +0100 Subject: [PATCH] Address shellcheck findings in utest/report.sh --- utest/report.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utest/report.sh b/utest/report.sh index e570ed9..3261451 100755 --- a/utest/report.sh +++ b/utest/report.sh @@ -26,18 +26,18 @@ if [[ $(uname) == "Darwin" ]]; then branchCoverage=branch_coverage fi -if test -n "$(find ${OUT_DIR} -maxdepth 1 -name '*.gcda' -print -quit)" \ - && test -n "$(find ${OUT_DIR} -maxdepth 1 -name '*.gcno' -print -quit)" \ +if test -n "$(find "${OUT_DIR}" -maxdepth 1 -name '*.gcda' -print -quit)" \ + && test -n "$(find "${OUT_DIR}" -maxdepth 1 -name '*.gcno' -print -quit)" \ && test -n "$(lcov --version)" then - mkdir -p ${testResultsDir} - mkdir -p ${testReportDir} - cp ${OUT_DIR}/*.gc* ${testResultsDir} - lcov --capture --directory ${testResultsDir} --base-directory ${SRC_DIR} --test-name ${tcBaseName} --quiet \ + mkdir -p "${testResultsDir}" + mkdir -p "${testReportDir}" + cp "${OUT_DIR}"/*.gc* "${testResultsDir}" + lcov --capture --directory "${testResultsDir}" --base-directory "${SRC_DIR}" --test-name ${tcBaseName} --quiet \ --exclude '*/lex.yy.c' --exclude '*/parser.c' --rc "${branchCoverage}=1" \ - --output-file ${testResultsDir}/coverage.info + --output-file "${testResultsDir}/coverage.info" echo -n "[ Coverage ] " - genhtml --title "Boxes / Unit Tests" --branch-coverage --legend --output-directory ${testReportDir} \ - ${testResultsDir}/coverage.info | grep 'lines...' | grep -oP '\d+\.\d*%' + genhtml --title "Boxes / Unit Tests" --branch-coverage --legend --output-directory "${testReportDir}" \ + "${testResultsDir}/coverage.info" | grep 'lines...' | grep -oP '\d+\.\d*%' echo "[ Report ] Unit test coverage report available at ${testReportDir}/index.html" fi