chore: remove emscripten.rs platform from coverage, add html generation task, hide absolute path with remap-path-prefix, organize gitignore

This commit is contained in:
2025-08-12 19:57:52 -05:00
parent a230d15ffc
commit 90bdfbd2ae
2 changed files with 28 additions and 4 deletions
Vendored
+12 -3
View File
@@ -1,8 +1,17 @@
# IDE, Other files
.vscode
.idea
rust-sdl2-emscripten/
# Build files
target/ target/
dist/ dist/
emsdk/ emsdk/
.idea
rust-sdl2-emscripten/ # Site build f iles
assets/site/build.css
tailwindcss-* tailwindcss-*
assets/site/build.css
# Coverage reports
lcov.info lcov.info
coverage.html
+16 -1
View File
@@ -1,17 +1,32 @@
set shell := ["bash", "-c"] set shell := ["bash", "-c"]
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
coverage_exclude_pattern := "app.rs|audio.rs|error.rs" # Regex to exclude files from coverage report, double escapes for Justfile + CLI
# You can use src\\\\..., but the filename alone is acceptable too
coverage_exclude_pattern := "src\\\\app.rs|audio.rs|src\\\\error.rs|platform\\\\emscripten.rs"
# !!! --ignore-filename-regex should be used on both reports & coverage testing
# !!! --remap-path-prefix prevents the absolute path from being used in the generated report
# Generate HTML report (for humans, source line inspection)
html: coverage
cargo llvm-cov report \
--remap-path-prefix \
--ignore-filename-regex "{{ coverage_exclude_pattern }}" \
--html \
--open
# Display report (for humans) # Display report (for humans)
report-coverage: coverage report-coverage: coverage
cargo llvm-cov report \ cargo llvm-cov report \
--remap-path-prefix \
--ignore-filename-regex "{{ coverage_exclude_pattern }}" --ignore-filename-regex "{{ coverage_exclude_pattern }}"
# Run & generate report (for CI) # Run & generate report (for CI)
coverage: coverage:
cargo llvm-cov \ cargo llvm-cov \
--lcov \ --lcov \
--remap-path-prefix \
--ignore-filename-regex "{{ coverage_exclude_pattern }}" \ --ignore-filename-regex "{{ coverage_exclude_pattern }}" \
--output-path lcov.info \ --output-path lcov.info \
--profile coverage \ --profile coverage \