mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-06 10:10:17 +00:00
update cov
This commit is contained in:
parent
ef9b4779f4
commit
ab513822b3
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -64,6 +64,10 @@ jobs:
|
||||
bash build_g.sh
|
||||
bash run_tests.sh
|
||||
rm -rf ./main
|
||||
- name: Run Script Check
|
||||
run: |
|
||||
python scripts/check_pragma_once.py include
|
||||
python scripts/check_undef.py src
|
||||
- name: Unit Test with Coverage
|
||||
run: bash run_tests.sh
|
||||
- name: Upload coverage reports to Codecov
|
||||
|
||||
13
run_tests.sh
13
run_tests.sh
@ -4,7 +4,7 @@ python prebuild.py
|
||||
|
||||
SRC=$(find src/ -name "*.c")
|
||||
|
||||
clang -std=c11 --coverage -O1 -Wfatal-errors -o main src2/main.c $SRC -Iinclude -DPK_ENABLE_OS=1 -DPK_ENABLE_PROFILER=1 -lm -ldl -DNDEBUG
|
||||
clang -std=c11 --coverage -O1 -Wfatal-errors -o main src2/main.c $SRC -Iinclude -DPK_ENABLE_OS=1 -lm -ldl -DNDEBUG
|
||||
|
||||
python scripts/run_tests.py
|
||||
|
||||
@ -16,8 +16,17 @@ fi
|
||||
rm -rf .coverage
|
||||
mkdir .coverage
|
||||
|
||||
# remove .gcno files if the 1st line contains "Source:src/debugger/"
|
||||
find . -type f -name "*.gcno" | while read -r file; do
|
||||
first_line=$(head -n 1 "$file")
|
||||
if [[ "$first_line" == *"Source:src/debugger/"* ]]; then
|
||||
echo "Deleting: $file"
|
||||
rm -f "$file"
|
||||
fi
|
||||
done
|
||||
|
||||
UNITS=$(find ./ -name "*.gcno")
|
||||
llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
|
||||
llvm-cov-17 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
|
||||
|
||||
mv *.gcov .coverage
|
||||
rm *.gcda
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user