2626
2727set -ux
2828
29- FEATURES_OPTION=" --features feat_os_unix"
30-
3129ME=" ${0} "
3230ME_dir=" $( dirname -- " $( readlink -fm -- " ${ME} " ) " ) "
3331REPO_main_dir=" $( dirname -- " ${ME_dir} " ) "
3432
33+ FEATURES_OPTION=${FEATURES_OPTION:- " --features feat_os_unix" }
34+ COVERAGE_DIR=${COVERAGE_DIR:- " ${REPO_main_dir} /coverage" }
35+
3536LLVM_BIN_PATH=" $( rustc --print sysroot) /lib/rustlib/x86_64-unknown-linux-gnu/bin"
3637LLVM_PROFDATA=" ${LLVM_BIN_PATH} /llvm-profdata"
3738
38- PROFRAW_DIR=" ${REPO_main_dir} /coverage/traces"
39- PROFDATA_DIR=" ${REPO_main_dir} /coverage/data"
40- REPORT_DIR=" ${REPO_main_dir} /coverage/report"
39+ PROFRAW_DIR=" ${COVERAGE_DIR} /traces"
40+ PROFDATA_DIR=" ${COVERAGE_DIR} /data"
41+ REPORT_DIR=" ${COVERAGE_DIR} /report"
42+ REPORT_PATH=" ${REPORT_DIR} /total.lcov.info"
4143
4244rm -rf " ${PROFRAW_DIR} " && mkdir -p " ${PROFRAW_DIR} "
4345rm -rf " ${PROFDATA_DIR} " && mkdir -p " ${PROFDATA_DIR} "
@@ -60,7 +62,11 @@ for UTIL in ${UTIL_LIST}; do
6062 --no-fail-fast \
6163 ${FEATURES_OPTION} \
6264 -p coreutils \
63- -E " test(test_${UTIL} )" # Filter to only run tests against the selected util.
65+ -E " test(test_${UTIL} )" \
66+ --color=always \
67+ 2>&1 \
68+ | grep -v ' SKIP'
69+ # Note: Do not print the skipped tests on the output as there will be many.
6470
6571 echo -e " ${UTIL} trace generation: $( du -h -d1 ${PROFRAW_DIR} ) " >> " ${REPORT_DIR} /usage"
6672
@@ -79,6 +85,9 @@ grcov \
7985 " ${PROFDATA_DIR} " \
8086 --binary-path " ${REPO_main_dir} /target/debug/coreutils" \
8187 --output-types lcov \
82- --output-path " ${REPORT_DIR} /${UTIL} .lcov.info" \
88+ --output-path " ${REPORT_DIR} /total .lcov.info" \
8389 --llvm \
8490 --keep-only " ${REPO_main_dir} " ' /src/*'
91+
92+ # Notify the report file to github
93+ echo " report=${REPORT_PATH} " >> $GITHUB_OUTPUT
0 commit comments