Skip to content

Commit

Permalink
Ignore unused_mod.rs file in code coverage results
Browse files Browse the repository at this point in the history
As discussed in
rust-lang#92142 (comment),
tests that contain multiple files order their results differently on
Windows and Linux which the test runner currently can't handle
correctly. For now, ignore the "bin" part of the test and only include
the unused library dependency which is what the test really cares about
anyway.
  • Loading branch information
wesleywiser committed Jan 10, 2022
1 parent ebc0d0d commit e9cac4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/coverage-reports/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ endif
# if and when we allow `llvm-cov` to produce results for multiple files. Note, the path separators
# appear to be normalized to `/` in those files, thankfully.)
LLVM_COV_IGNORE_FILES=\
--ignore-filename-regex='(uses_crate.rs|uses_inline_crate.rs)'
--ignore-filename-regex='(uses_crate.rs|uses_inline_crate.rs|unused_mod.rs)'

all: $(patsubst $(SOURCEDIR)/lib/%.rs,%,$(wildcard $(SOURCEDIR)/lib/*.rs)) $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
../coverage/lib/unused_mod_helper.rs:
1| 0|pub fn never_called_function() {
2| 0| println!("I am never called");
3| 0|}

../coverage/unused_mod.rs:
1| |#[path = "lib/unused_mod_helper.rs"]
2| |mod unused_module;
3| |
4| 1|fn main() {
5| 1| println!("hello world!");
6| 1|}

0 comments on commit e9cac4c

Please sign in to comment.