-
-
Notifications
You must be signed in to change notification settings - Fork 221
Expand file tree
/
Copy pathrun_tests.sh
More file actions
33 lines (24 loc) · 739 Bytes
/
Copy pathrun_tests.sh
File metadata and controls
33 lines (24 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set -e
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 -lm -ldl -DNDEBUG
python scripts/run_tests.py
# if prev error exit
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf .coverage
mkdir .coverage
UNITS=$(find ./ -name "*.gcno")
llvm-cov-19 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
mv *.gcov .coverage
rm *.gcda
rm *.gcno
# remove .gcno files if the 1st line contains "Source:src/debugger/"
find .coverage/ -type f -name "*.gcov" | while read -r file; do
first_line=$(head -n 1 "$file")
if [[ "$first_line" == *"Source:src/debugger/"* ]]; then
echo "Removing: $file"
rm "$file"
fi
done