Skip to content

Commit 1065590

Browse files
committed
ci: add racesan to coverage report
1 parent ab8bbf3 commit 1065590

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/coverage_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
MACHINES="linux_clang_x86_64 linux_clang_haswell linux_clang_icelake" \
3939
EXTRAS="llvm-cov" \
4040
COV_REPORT=1 \
41+
RACESAN=1 \
4142
contrib/test/ci_tests.sh
4243
4344
- name: 'Authenticate to Google Cloud'

contrib/test/ci_tests.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ for extra in $EXTRAS; do
2525
done
2626
export EXTRAS
2727

28+
export FD_LOG_LEVEL_STDERR=3
29+
2830
set -x
2931

3032
# Build and run tests for all machines
@@ -34,7 +36,7 @@ for MACHINE in ${MACHINES[*]}; do
3436
OBJDIR="$(make help | grep OBJDIR | awk '{print $4}')"
3537
OBJDIRS+=( "${OBJDIR}" )
3638
make clean --silent >/dev/null
37-
contrib/make-j $TARGETS
39+
contrib/make-j $TARGETS >/dev/null
3840
if [[ "$NOTEST" != 1 ]]; then
3941
make run-unit-test
4042
make run-fuzz-test
@@ -50,6 +52,22 @@ for MACHINE in ${MACHINES[*]}; do
5052
export -n MACHINE
5153
done
5254

55+
if [[ "$RACESAN" == 1 ]]; then
56+
rm -rf build/racesan
57+
MACHINE=native CC=clang EXTRAS="$EXTRAS racesan" BUILDDIR=racesan contrib/make-j unit-test >/dev/null
58+
mkdir -p build/racesan/cov/raw
59+
for test in $(find build/racesan/unit-test -type f -executable -name '*racesan*'); do
60+
LLVM_PROFILE_FILE="build/racesan/cov/raw/$(basename "$test").profraw"
61+
export LLVM_PROFILE_FILE
62+
"$test" --page-cnt 2 --page-sz gigantic --log-path '' >/dev/null
63+
unset LLVM_PROFILE_FILE
64+
if [[ "$HAS_LLVM_COV" == 1 ]]; then
65+
MACHINE=native CC=clang EXTRAS="$EXTRAS racesan" BUILDDIR=racesan make "build/racesan/cov/cov.lcov"
66+
fi
67+
done
68+
OBJDIRS+=( "build/racesan" )
69+
fi
70+
5371
# Export coverage report
5472
if [[ "$COV_REPORT" == 1 ]]; then
5573
make dist-cov-report OBJDIRS="${OBJDIRS[*]}"

0 commit comments

Comments
 (0)