From e9cac4ca627a4da45d24ca7341bb7c66aa59cbe2 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Mon, 10 Jan 2022 09:55:52 -0500 Subject: [PATCH] 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. --- src/test/run-make-fulldeps/coverage-reports/Makefile | 2 +- .../expected_show_coverage.unused_mod.txt | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/test/run-make-fulldeps/coverage-reports/Makefile b/src/test/run-make-fulldeps/coverage-reports/Makefile index 9122e0406c2..094d6b3ebf5 100644 --- a/src/test/run-make-fulldeps/coverage-reports/Makefile +++ b/src/test/run-make-fulldeps/coverage-reports/Makefile @@ -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)) diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.unused_mod.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.unused_mod.txt index d902b7a412f..82d6fccc271 100644 --- a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.unused_mod.txt +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.unused_mod.txt @@ -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|} -