Ignore unused_mod.rs file in code coverage results

As discussed in
https://github.com/rust-lang/rust/pull/92142#issuecomment-1008239473,
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.
This commit is contained in:
Wesley Wiser 2022-01-10 09:55:52 -05:00
parent ebc0d0d2a8
commit e9cac4ca62
2 changed files with 1 additions and 10 deletions

View File

@ -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))

View File

@ -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|}