Skip to content

Commit

Permalink
TST: Added testcases for html coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ganesh-k13 committed Jan 27, 2024
1 parent 83e3a1d commit cd31d6a
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
echo "Yes"
fi
ptest Does the debug build contain gcov files?
matching_files=$(find . -type f -name "*.gc*")
matching_files=$(find . -type f -name "*.gcno")
if [ -z "$matching_files" ]; then
perror Debug files did not get generated
exit 1
Expand Down Expand Up @@ -89,9 +89,42 @@ if [[ $PLATFORM == linux || $PLATFORM == darwin ]]; then
fi
fi

## `spin test` test cases
ptest test command runs
prun spin test

ptest does gcov test generate coverage files
prun spin test --gcov
matching_files=$(find . -type f -name "*.gcda")
if [ -z "$matching_files" ]; then
perror Coverage files did not get generated
exit 1
else
echo "Yes"
fi

# TODO: Test other coverage reports
prun pip install gcovr lcov
ptest does gcov test generate coverage reports
prun spin test --generate-gcov-report html
if [ ! -f "build/meson-logs/coveragereport/index.html" ]; then
perror Coverage report did not get generated
exit 1
else
echo "Yes"
fi

ptest does gcov build generate coverage files
prun spin test --gcov
matching_files=$(find . -type f -name "*.gcda")
if [ -z "$matching_files" ]; then
perror Coverage files did not get generated
exit 1
else
echo "Yes"
fi


ptest Does \`spin test\` work when PYTHONPATH is set?
PYTHONPATH=./tmp spin test

Expand Down

0 comments on commit cd31d6a

Please sign in to comment.