Skip to content

Commit

Permalink
Merge pull request #243 from chenyukang/trivial-fix-on-coverage
Browse files Browse the repository at this point in the history
Trivial fix on coverage
  • Loading branch information
quake authored Oct 17, 2024
2 parents ace68c8 + 5ef95a6 commit 44d1e41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/tests/deploy/udt-init/target
tests/nodes/.ports
/coverage-report
/coverage-report.info
/*.info
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CARGO_TARGET_DIR ?= target
COVERAGE_PROFRAW_DIR ?= ${CARGO_TARGET_DIR}/coverage
GRCOV_OUTPUT ?= coverage-report.info
GRCOV_EXCL_START = ^\s*((log::)?(trace|debug|info|warn|error)|(debug_)?assert(_eq|_ne|_error_eq))!\($$
GRCOV_EXCL_START = ^\s*((log::|tracing::)?(trace|debug|info|warn|error)|(debug_)?assert(_eq|_ne|_error_eq))!\($$
GRCOV_EXCL_STOP = ^\s*\)(;)?$$
GRCOV_EXCL_LINE = \s*((log::)?(trace|debug|info|warn|error)|(debug_)?assert(_eq|_ne|_error_eq))!\(.*\)(;)?$$
GRCOV_EXCL_LINE = ^\s*(\})*(\))*(;)*$$|\s*((log::|tracing::)?(trace|debug|info|warn|error)|(debug_)?assert(_eq|_ne|_error_eq))!\(.*\)(;)?$$

.PHONY: clippy
clippy:
Expand All @@ -28,6 +28,7 @@ coverage-run-unittests:
mkdir -p "${COVERAGE_PROFRAW_DIR}"
rm -f "${COVERAGE_PROFRAW_DIR}/*.profraw"
RUSTFLAGS="${RUSTFLAGS} -Cinstrument-coverage" \
RUST_LOG=off \
LLVM_PROFILE_FILE="${COVERAGE_PROFRAW_DIR}/unittests-%p-%m.profraw" \
cargo test --all

Expand All @@ -44,4 +45,6 @@ coverage-collect-data:
-o "${GRCOV_OUTPUT}"

coverage-generate-report:
genhtml -o "${GRCOV_OUTPUT:.info=}" "${GRCOV_OUTPUT}"
genhtml --ignore-errors inconsistent --ignore-errors corrupt --ignore-errors range --ignore-errors unmapped -o "${GRCOV_OUTPUT:.info=}" "${GRCOV_OUTPUT}"

coverage: coverage-run-unittests coverage-collect-data coverage-generate-report

0 comments on commit 44d1e41

Please sign in to comment.