diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml index 6cae5d7239..624d5a5a4c 100644 --- a/.github/workflows/coverage_report.yml +++ b/.github/workflows/coverage_report.yml @@ -38,6 +38,7 @@ jobs: MACHINES="linux_clang_x86_64 linux_clang_haswell linux_clang_icelake" \ EXTRAS="llvm-cov" \ COV_REPORT=1 \ + RACESAN=1 \ contrib/test/ci_tests.sh - name: 'Authenticate to Google Cloud' diff --git a/contrib/test/ci_tests.sh b/contrib/test/ci_tests.sh index c1f1a4e75f..a0ba33de85 100755 --- a/contrib/test/ci_tests.sh +++ b/contrib/test/ci_tests.sh @@ -25,6 +25,8 @@ for extra in $EXTRAS; do done export EXTRAS +export FD_LOG_LEVEL_STDERR=3 + set -x # Build and run tests for all machines @@ -34,7 +36,7 @@ for MACHINE in ${MACHINES[*]}; do OBJDIR="$(make help | grep OBJDIR | awk '{print $4}')" OBJDIRS+=( "${OBJDIR}" ) make clean --silent >/dev/null - contrib/make-j $TARGETS + contrib/make-j $TARGETS >/dev/null if [[ "$NOTEST" != 1 ]]; then make run-unit-test make run-fuzz-test @@ -50,6 +52,22 @@ for MACHINE in ${MACHINES[*]}; do export -n MACHINE done +if [[ "$RACESAN" == 1 ]]; then + rm -rf build/racesan + MACHINE=native CC=clang EXTRAS="$EXTRAS racesan" BUILDDIR=racesan contrib/make-j unit-test >/dev/null + mkdir -p build/racesan/cov/raw + for test in $(find build/racesan/unit-test -type f -executable -name '*racesan*'); do + LLVM_PROFILE_FILE="build/racesan/cov/raw/$(basename "$test").profraw" + export LLVM_PROFILE_FILE + "$test" --page-cnt 2 --page-sz gigantic --log-path '' >/dev/null + unset LLVM_PROFILE_FILE + if [[ "$HAS_LLVM_COV" == 1 ]]; then + MACHINE=native CC=clang EXTRAS="$EXTRAS racesan" BUILDDIR=racesan make "build/racesan/cov/cov.lcov" + fi + done + OBJDIRS+=( "build/racesan" ) +fi + # Export coverage report if [[ "$COV_REPORT" == 1 ]]; then make dist-cov-report OBJDIRS="${OBJDIRS[*]}"