about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-08 21:43:05 +0200
committerJakub Beránek <berykubik@gmail.com>2025-08-13 08:11:00 +0200
commit23bb607184e51870b278de3bcd2e8786c54faedf (patch)
tree762e92b9f882402abfd8b7238538a716e1a06714
parent87d92eecf925e990c6db13a8c2a56e36d4905ea9 (diff)
downloadrust-23bb607184e51870b278de3bcd2e8786c54faedf.tar.gz
rust-23bb607184e51870b278de3bcd2e8786c54faedf.zip
Add more tests
-rw-r--r--src/bootstrap/src/core/build_steps/clippy.rs2
-rw-r--r--src/bootstrap/src/core/builder/tests.rs90
2 files changed, 83 insertions, 9 deletions
diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs
index d8cf3d0c488..b71e5fbb95c 100644
--- a/src/bootstrap/src/core/build_steps/clippy.rs
+++ b/src/bootstrap/src/core/build_steps/clippy.rs
@@ -447,7 +447,7 @@ macro_rules! lint_any {
             }
 
             fn metadata(&self) -> Option<StepMetadata> {
-                Some(StepMetadata::clippy($readable_name, self.target))
+                Some(StepMetadata::clippy($readable_name, self.target).built_by(self.build_compiler))
             }
         }
         )+
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs
index 28bec10f061..7fdbdd05fb6 100644
--- a/src/bootstrap/src/core/builder/tests.rs
+++ b/src/bootstrap/src/core/builder/tests.rs
@@ -2073,12 +2073,11 @@ mod snapshot {
             ctx.config("clippy")
                 .path("ci")
                 .render_steps(), @r"
+        [clippy] rustc 0 <host> -> bootstrap 1 <host>
         [build] llvm <host>
         [build] rustc 0 <host> -> rustc 1 <host>
-        [check] rustc 1 <host> -> rustc 2 <host>
         [build] rustc 0 <host> -> clippy-driver 1 <host>
         [build] rustc 0 <host> -> cargo-clippy 1 <host>
-        [clippy] bootstrap <host>
         [clippy] rustc 1 <host> -> std 1 <host>
         [clippy] rustc 0 <host> -> rustc 1 <host>
         [clippy] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
@@ -2096,21 +2095,20 @@ mod snapshot {
         [build] llvm <host>
         [build] rustc 0 <host> -> rustc 1 <host>
         [build] rustc 1 <host> -> std 1 <host>
+        [build] rustc 0 <host> -> clippy-driver 1 <host>
+        [build] rustc 0 <host> -> cargo-clippy 1 <host>
+        [clippy] rustc 1 <host> -> bootstrap 2 <host>
         [build] rustc 1 <host> -> rustc 2 <host>
-        [check] rustc 2 <host> -> rustc 3 <host>
         [build] rustc 1 <host> -> clippy-driver 2 <host>
         [build] rustc 1 <host> -> cargo-clippy 2 <host>
-        [clippy] bootstrap <host>
         [clippy] rustc 2 <host> -> std 2 <host>
-        [build] rustc 0 <host> -> clippy-driver 1 <host>
-        [build] rustc 0 <host> -> cargo-clippy 1 <host>
         [clippy] rustc 1 <host> -> rustc 2 <host>
         [clippy] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
         ");
     }
 
     #[test]
-    fn clippy_compiler() {
+    fn clippy_compiler_stage1() {
         let ctx = TestCtx::new();
         insta::assert_snapshot!(
             ctx.config("clippy")
@@ -2122,7 +2120,24 @@ mod snapshot {
     }
 
     #[test]
-    fn clippy_std() {
+    fn clippy_compiler_stage2() {
+        let ctx = TestCtx::new();
+        insta::assert_snapshot!(
+            ctx.config("clippy")
+                .path("compiler")
+                .stage(2)
+                .render_steps(), @r"
+        [build] llvm <host>
+        [build] rustc 0 <host> -> rustc 1 <host>
+        [build] rustc 1 <host> -> std 1 <host>
+        [build] rustc 0 <host> -> clippy-driver 1 <host>
+        [build] rustc 0 <host> -> cargo-clippy 1 <host>
+        [clippy] rustc 1 <host> -> rustc 2 <host>
+        ");
+    }
+
+    #[test]
+    fn clippy_std_stage1() {
         let ctx = TestCtx::new();
         insta::assert_snapshot!(
             ctx.config("clippy")
@@ -2135,6 +2150,65 @@ mod snapshot {
         [clippy] rustc 1 <host> -> std 1 <host>
         ");
     }
+
+    #[test]
+    fn clippy_std_stage2() {
+        let ctx = TestCtx::new();
+        insta::assert_snapshot!(
+            ctx.config("clippy")
+                .path("std")
+                .stage(2)
+                .render_steps(), @r"
+        [build] llvm <host>
+        [build] rustc 0 <host> -> rustc 1 <host>
+        [build] rustc 1 <host> -> std 1 <host>
+        [build] rustc 1 <host> -> rustc 2 <host>
+        [build] rustc 1 <host> -> clippy-driver 2 <host>
+        [build] rustc 1 <host> -> cargo-clippy 2 <host>
+        [clippy] rustc 2 <host> -> std 2 <host>
+        ");
+    }
+
+    #[test]
+    fn clippy_miri_stage1() {
+        let ctx = TestCtx::new();
+        insta::assert_snapshot!(
+            ctx.config("clippy")
+                .path("miri")
+                .stage(1)
+                .render_steps(), @r"
+        [build] llvm <host>
+        [check] rustc 0 <host> -> rustc 1 <host>
+        [clippy] rustc 0 <host> -> miri 1 <host>
+        ");
+    }
+
+    #[test]
+    fn clippy_miri_stage2() {
+        let ctx = TestCtx::new();
+        insta::assert_snapshot!(
+            ctx.config("clippy")
+                .path("miri")
+                .stage(2)
+                .render_steps(), @r"
+        [build] llvm <host>
+        [build] rustc 0 <host> -> rustc 1 <host>
+        [build] rustc 1 <host> -> std 1 <host>
+        [check] rustc 1 <host> -> rustc 2 <host>
+        [build] rustc 0 <host> -> clippy-driver 1 <host>
+        [build] rustc 0 <host> -> cargo-clippy 1 <host>
+        [clippy] rustc 1 <host> -> miri 2 <host>
+        ");
+    }
+
+    #[test]
+    fn clippy_bootstrap() {
+        let ctx = TestCtx::new();
+        insta::assert_snapshot!(
+            ctx.config("clippy")
+                .path("bootstrap")
+                .render_steps(), @"[clippy] rustc 0 <host> -> bootstrap 1 <host>");
+    }
 }
 
 struct ExecutedSteps {