From a2c0b388970c95e9ccb088e2abc2cb4f02ed90ae Mon Sep 17 00:00:00 2001 From: Zalathar Date: Mon, 12 Jun 2023 18:07:04 +1000 Subject: Migrate the remaining `run-make/coverage-reports` tests over to `run-coverage` To make it easier to verify that the output snapshots have been migrated faithfully, this change adds some temporary helper code that lets us avoid having to completely re-bless the existing snapshots. A later change in this PR will then re-bless the tests and remove the temporary helper code. --- src/tools/compiletest/src/runtest.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 8bdc2d65d27..9f2c45ca1cf 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -524,6 +524,14 @@ impl<'test> TestCx<'test> { let proc_res = self.run_llvm_tool("llvm-cov", |cmd| { cmd.args(["show", "--format=text", "--show-line-counts-or-regions"]); + // Temporarily ignore these files so that we can migrate the + // existing output snapshots mostly as-is. + // This code will be removed later in the same PR. + cmd.args([ + "--ignore-filename-regex", + "(uses_crate.rs|uses_inline_crate.rs|unused_mod.rs)", + ]); + cmd.arg("--Xdemangler"); cmd.arg(self.config.rust_demangler_path.as_ref().unwrap()); @@ -690,6 +698,10 @@ impl<'test> TestCx<'test> { // Sort the file sections (not including the final empty "section"). let except_last = sections.len() - 1; (&mut sections[..except_last]).sort(); + // Temporarily sort the file sections in reverse order so that we can + // migrate the existing output snapshots mostly as-is. + // This code will be removed later in the same PR. + (&mut sections[..except_last]).sort_by(|a, b| b.cmp(a)); // Join the file sections back into a flat list of lines, with // sections separated by blank lines. -- cgit 1.4.1-3-g733a5