about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-06-12 18:07:04 +1000
committerZalathar <Zalathar@users.noreply.github.com>2023-06-28 11:09:19 +1000
commita2c0b388970c95e9ccb088e2abc2cb4f02ed90ae (patch)
tree481333e971402d7239b3cad765e9ab3a188b4773 /src/tools/compiletest
parent9d2564a1102bf20f5310c872582518302e5f049b (diff)
downloadrust-a2c0b388970c95e9ccb088e2abc2cb4f02ed90ae.tar.gz
rust-a2c0b388970c95e9ccb088e2abc2cb4f02ed90ae.zip
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.
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs12
1 files changed, 12 insertions, 0 deletions
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.