sunnypilot v2026.002.000
version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
This commit is contained in:
commit
de77c89cf6
3995 files changed
+1260688
No files matched your search
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
cd $DIR
|
||||
|
||||
source ../../../setup.sh
|
||||
|
||||
# reset coverage data
|
||||
rm -f ./libsafety/*.gcda
|
||||
|
||||
# run safety tests and generate coverage data
|
||||
python -m unittest discover -s .
|
||||
|
||||
# NOTE: we accept that these tools will have slight differences,
|
||||
# and in return, we get to use the stock toolchain instead of
|
||||
# installing LLVM on all users' machines
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
GCOV_EXEC="llvm-cov gcov"
|
||||
else
|
||||
GCOV_EXEC="gcov"
|
||||
fi
|
||||
|
||||
# generate and open report
|
||||
if [ "$1" == "--report" ]; then
|
||||
mkdir -p coverage-out
|
||||
gcovr -r ../ --gcov-executable "$GCOV_EXEC" --html-nested coverage-out/index.html
|
||||
sensible-browser coverage-out/index.html
|
||||
fi
|
||||
|
||||
# test coverage
|
||||
GCOV="gcovr -r $DIR/../ --gcov-executable \"$GCOV_EXEC\" -d --fail-under-line=100 -e ^libsafety"
|
||||
if ! GCOV_OUTPUT="$(eval $GCOV)"; then
|
||||
echo -e "FAILED:\n$GCOV_OUTPUT"
|
||||
exit 1
|
||||
else
|
||||
echo "SUCCESS: All checked files have 100% coverage!"
|
||||
fi
|
||||
Reference in new issue
Block a user