]> git.lizzy.rs Git - rust.git/commitdiff
add bootstrap cfg
authorAliénore Bouttefeux <alienore.bouttefeux@gmail.com>
Sun, 9 May 2021 11:37:09 +0000 (13:37 +0200)
committerAliénore Bouttefeux <alienore.bouttefeux@gmail.com>
Sun, 9 May 2021 11:37:09 +0000 (13:37 +0200)
library/test/src/formatters/pretty.rs
library/test/src/formatters/terse.rs
library/test/src/tests.rs
library/test/src/types.rs
src/librustdoc/doctest.rs
src/tools/compiletest/src/main.rs

index 543b9a6924ac6fadb20b6df83c59a8c6d608c9ea..c1a0bb9f3e1e7951d364e985efcac360b01931e9 100644 (file)
@@ -169,7 +169,7 @@ pub fn write_time_failures(&mut self, state: &ConsoleTestState) -> io::Result<()
 
     fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
         let name = desc.padded_name(self.max_name_len, desc.name.padding());
-        self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;
+        self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode()))?;
 
         Ok(())
     }
index 286b50b525d4bf6bfd778ab1c1f4c58d527bc1be..a9589829ad270e574fac51b10b64556120d81983 100644 (file)
@@ -158,7 +158,7 @@ pub fn write_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
 
     fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
         let name = desc.padded_name(self.max_name_len, desc.name.padding());
-        self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;
+        self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode()))?;
 
         Ok(())
     }
index 794f72770047646780b7478956dd2e74979f8c4c..5a4a540b04eb04c92eb2a0b4b8c092194ac65770 100644 (file)
@@ -61,7 +61,9 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
                 ignore: true,
                 should_panic: ShouldPanic::No,
                 allow_fail: false,
+                #[cfg(not(bootstrap))]
                 compile_fail: false,
+                #[cfg(not(bootstrap))]
                 no_run: false,
                 test_type: TestType::Unknown,
             },
@@ -73,7 +75,9 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
                 ignore: false,
                 should_panic: ShouldPanic::No,
                 allow_fail: false,
+                #[cfg(not(bootstrap))]
                 compile_fail: false,
+                #[cfg(not(bootstrap))]
                 no_run: false,
                 test_type: TestType::Unknown,
             },
@@ -93,7 +97,9 @@ fn f() {
             ignore: true,
             should_panic: ShouldPanic::No,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -114,7 +120,9 @@ fn f() {}
             ignore: true,
             should_panic: ShouldPanic::No,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -139,7 +147,9 @@ fn f() {
             ignore: false,
             should_panic: ShouldPanic::Yes,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -164,7 +174,9 @@ fn f() {
             ignore: false,
             should_panic: ShouldPanic::YesWithMessage("error message"),
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -194,7 +206,9 @@ fn f() {
             ignore: false,
             should_panic: ShouldPanic::YesWithMessage(expected),
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -228,7 +242,9 @@ fn f() {
             ignore: false,
             should_panic: ShouldPanic::YesWithMessage(expected),
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -254,7 +270,9 @@ fn f() {}
                 ignore: false,
                 should_panic,
                 allow_fail: false,
+                #[cfg(not(bootstrap))]
                 compile_fail: false,
+                #[cfg(not(bootstrap))]
                 no_run: false,
                 test_type: TestType::Unknown,
             },
@@ -288,7 +306,9 @@ fn f() {}
             ignore: false,
             should_panic: ShouldPanic::No,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -323,7 +343,9 @@ fn f() {}
             ignore: false,
             should_panic: ShouldPanic::No,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type,
         },
@@ -362,7 +384,9 @@ fn typed_test_desc(test_type: TestType) -> TestDesc {
         ignore: false,
         should_panic: ShouldPanic::No,
         allow_fail: false,
+        #[cfg(not(bootstrap))]
         compile_fail: false,
+        #[cfg(not(bootstrap))]
         no_run: false,
         test_type,
     }
@@ -475,7 +499,9 @@ pub fn exclude_should_panic_option() {
             ignore: false,
             should_panic: ShouldPanic::Yes,
             allow_fail: false,
+            #[cfg(not(bootstrap))]
             compile_fail: false,
+            #[cfg(not(bootstrap))]
             no_run: false,
             test_type: TestType::Unknown,
         },
@@ -499,7 +525,9 @@ fn tests() -> Vec<TestDescAndFn> {
                     ignore: false,
                     should_panic: ShouldPanic::No,
                     allow_fail: false,
+                    #[cfg(not(bootstrap))]
                     compile_fail: false,
+                    #[cfg(not(bootstrap))]
                     no_run: false,
                     test_type: TestType::Unknown,
                 },
@@ -593,7 +621,9 @@ fn testfn() {}
                     ignore: false,
                     should_panic: ShouldPanic::No,
                     allow_fail: false,
+                    #[cfg(not(bootstrap))]
                     compile_fail: false,
+                    #[cfg(not(bootstrap))]
                     no_run: false,
                     test_type: TestType::Unknown,
                 },
@@ -672,7 +702,9 @@ fn f(_: &mut Bencher) {}
         ignore: false,
         should_panic: ShouldPanic::No,
         allow_fail: false,
+        #[cfg(not(bootstrap))]
         compile_fail: false,
+        #[cfg(not(bootstrap))]
         no_run: false,
         test_type: TestType::Unknown,
     };
@@ -694,7 +726,9 @@ fn f(b: &mut Bencher) {
         ignore: false,
         should_panic: ShouldPanic::No,
         allow_fail: false,
+        #[cfg(not(bootstrap))]
         compile_fail: false,
+        #[cfg(not(bootstrap))]
         no_run: false,
         test_type: TestType::Unknown,
     };
@@ -710,7 +744,9 @@ fn should_sort_failures_before_printing_them() {
         ignore: false,
         should_panic: ShouldPanic::No,
         allow_fail: false,
+        #[cfg(not(bootstrap))]
         compile_fail: false,
+        #[cfg(not(bootstrap))]
         no_run: false,
         test_type: TestType::Unknown,
     };
@@ -720,7 +756,9 @@ fn should_sort_failures_before_printing_them() {
         ignore: false,
         should_panic: ShouldPanic::No,
         allow_fail: false,
+        #[cfg(not(bootstrap))]
         compile_fail: false,
+        #[cfg(not(bootstrap))]
         no_run: false,
         test_type: TestType::Unknown,
     };
index a2c3d5fa8eeb47a9c7fb50d34b146135b90ec323..4cbdc7affc6572ae95685ab38a7e5b954a9fffd2 100644 (file)
@@ -124,7 +124,9 @@ pub struct TestDesc {
     pub ignore: bool,
     pub should_panic: options::ShouldPanic,
     pub allow_fail: bool,
+    #[cfg(not(bootstrap))]
     pub compile_fail: bool,
+    #[cfg(not(bootstrap))]
     pub no_run: bool,
     pub test_type: TestType,
 }
@@ -143,7 +145,8 @@ pub fn padded_name(&self, column_count: usize, align: NamePadding) -> String {
         }
     }
 
-    pub fn test_mode_string(&self) -> &'static str {
+    #[cfg(not(bootstrap))]
+    pub fn test_mode(&self) -> &'static str {
         if self.ignore {
             return &"ignore";
         }
@@ -164,6 +167,11 @@ pub fn test_mode_string(&self) -> &'static str {
         }
         &"run"
     }
+
+    #[cfg(bootstrap)]
+    pub fn test_mode(&self) -> &'static str {
+        &""
+    }
 }
 
 #[derive(Debug)]
index 8ef9170f9194582707c859dfe3b46ea0627571a3..c33d0ba4e57458ebced79bb66e266e39ed8f129f 100644 (file)
@@ -935,7 +935,9 @@ fn add_test(&mut self, test: String, config: LangString, line: usize) {
                 // compiler failures are test failures
                 should_panic: testing::ShouldPanic::No,
                 allow_fail: config.allow_fail,
+                #[cfg(not(bootstrap))]
                 compile_fail: config.compile_fail,
+                #[cfg(not(bootstrap))]
                 no_run,
                 test_type: testing::TestType::DocTest,
             },
index f3751ff244fd0720007ee4f52e473502cf8cd6ab..0aa1f336b6d483f9724251e0971070cf82689346 100644 (file)
@@ -649,7 +649,9 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
                     ignore,
                     should_panic,
                     allow_fail: false,
+                    #[cfg(not(bootstrap))]
                     compile_fail: false,
+                    #[cfg(not(bootstrap))]
                     no_run: false,
                     test_type: test::TestType::Unknown,
                 },