mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-01-08 06:58:49 +01:00
Address shellcheck findings in utest/report.sh
This commit is contained in:
parent
2727e0c997
commit
e6343dda0e
@ -26,18 +26,18 @@ if [[ $(uname) == "Darwin" ]]; then
|
|||||||
branchCoverage=branch_coverage
|
branchCoverage=branch_coverage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$(find ${OUT_DIR} -maxdepth 1 -name '*.gcda' -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 "$(find "${OUT_DIR}" -maxdepth 1 -name '*.gcno' -print -quit)" \
|
||||||
&& test -n "$(lcov --version)"
|
&& test -n "$(lcov --version)"
|
||||||
then
|
then
|
||||||
mkdir -p ${testResultsDir}
|
mkdir -p "${testResultsDir}"
|
||||||
mkdir -p ${testReportDir}
|
mkdir -p "${testReportDir}"
|
||||||
cp ${OUT_DIR}/*.gc* ${testResultsDir}
|
cp "${OUT_DIR}"/*.gc* "${testResultsDir}"
|
||||||
lcov --capture --directory ${testResultsDir} --base-directory ${SRC_DIR} --test-name ${tcBaseName} --quiet \
|
lcov --capture --directory "${testResultsDir}" --base-directory "${SRC_DIR}" --test-name ${tcBaseName} --quiet \
|
||||||
--exclude '*/lex.yy.c' --exclude '*/parser.c' --rc "${branchCoverage}=1" \
|
--exclude '*/lex.yy.c' --exclude '*/parser.c' --rc "${branchCoverage}=1" \
|
||||||
--output-file ${testResultsDir}/coverage.info
|
--output-file "${testResultsDir}/coverage.info"
|
||||||
echo -n "[ Coverage ] "
|
echo -n "[ Coverage ] "
|
||||||
genhtml --title "Boxes / Unit Tests" --branch-coverage --legend --output-directory ${testReportDir} \
|
genhtml --title "Boxes / Unit Tests" --branch-coverage --legend --output-directory "${testReportDir}" \
|
||||||
${testResultsDir}/coverage.info | grep 'lines...' | grep -oP '\d+\.\d*%'
|
"${testResultsDir}/coverage.info" | grep 'lines...' | grep -oP '\d+\.\d*%'
|
||||||
echo "[ Report ] Unit test coverage report available at ${testReportDir}/index.html"
|
echo "[ Report ] Unit test coverage report available at ${testReportDir}/index.html"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user