diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2024-09-07 22:16:00 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2024-09-07 22:16:12 +0200 |
| commit | fe54314b7b57fc703c2b3e3e6e2cd1f8ce9f5b83 (patch) | |
| tree | d1d15e7f8bd99d921f2bd0a159a40f48fdad901a /test/test.sh | |
| parent | 6ae1d00fca78145c73f826c5490452726b9bf161 (diff) | |
coverage
Diffstat (limited to 'test/test.sh')
| -rwxr-xr-x | test/test.sh | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/test.sh b/test/test.sh index e4eecee..52ffcc1 100755 --- a/test/test.sh +++ b/test/test.sh @@ -3,6 +3,7 @@ set -e cd "$(dirname "$0")" ulimit -s 4000000 export MALLOC_PERTURB_="$((2#01011001))" +shopt -s lastpipe declare -A cppstandard cppstandard["string/suffixArray.cpp"]="gnu++20" @@ -43,14 +44,31 @@ list_missing() { ignore["tests/precision.cpp"]=1 ignore["tests/whitespace.cpp"]=1 - echo "missing tests:" + total=0 + missing=0 + + if [[ ! -v $1 ]]; then + echo "missing tests:" + fi find ../content/ -type f -name '*.cpp' -print0 | sort -z | while read -d $'\0' file do + total=$((total+1)) file=${file#../content/} if [ ! -f "$file" ] && [[ ! -v ignore["$file"] ]]; then - echo " $file" + missing=$((missing+1)) + if [[ ! -v $1 ]]; then + echo " $file" + fi fi done + if [[ -v $1 ]]; then + coverage=$((100*(total-missing)/total)) + echo "COVERAGE=$coverage" + fi +} + +coverage() { + list_missing 1 } rm -rf ./awk/ @@ -66,6 +84,8 @@ if [ "$#" -ne 0 ]; then echo "processed all awk files" elif [[ $arg == "--missing" ]]; then list_missing + elif [[ $arg == "--coverage" ]]; then + coverage elif [[ $arg == --seed=* ]]; then seedmacro="-DSEED=${arg:7}ll" elif [ -d "$arg" ]; then |
