Skip to content

Commit f6b8b78

Browse files
committed
add bootstrap cfg
1 parent 6e99cb3 commit f6b8b78

File tree

6 files changed

+53
-3
lines changed

6 files changed

+53
-3
lines changed

library/test/src/formatters/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<T: Write> PrettyFormatter<T> {
169169

170170
fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
171171
let name = desc.padded_name(self.max_name_len, desc.name.padding());
172-
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;
172+
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode()))?;
173173

174174
Ok(())
175175
}

library/test/src/formatters/terse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<T: Write> TerseFormatter<T> {
158158

159159
fn write_test_name(&mut self, desc: &TestDesc) -> io::Result<()> {
160160
let name = desc.padded_name(self.max_name_len, desc.name.padding());
161-
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode_string()))?;
161+
self.write_plain(&format!("test {} - {} ... ", name, desc.test_mode()))?;
162162

163163
Ok(())
164164
}

library/test/src/tests.rs

+38
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
6161
ignore: true,
6262
should_panic: ShouldPanic::No,
6363
allow_fail: false,
64+
#[cfg(not(bootstrap))]
6465
compile_fail: false,
66+
#[cfg(not(bootstrap))]
6567
no_run: false,
6668
test_type: TestType::Unknown,
6769
},
@@ -73,7 +75,9 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
7375
ignore: false,
7476
should_panic: ShouldPanic::No,
7577
allow_fail: false,
78+
#[cfg(not(bootstrap))]
7679
compile_fail: false,
80+
#[cfg(not(bootstrap))]
7781
no_run: false,
7882
test_type: TestType::Unknown,
7983
},
@@ -93,7 +97,9 @@ pub fn do_not_run_ignored_tests() {
9397
ignore: true,
9498
should_panic: ShouldPanic::No,
9599
allow_fail: false,
100+
#[cfg(not(bootstrap))]
96101
compile_fail: false,
102+
#[cfg(not(bootstrap))]
97103
no_run: false,
98104
test_type: TestType::Unknown,
99105
},
@@ -114,7 +120,9 @@ pub fn ignored_tests_result_in_ignored() {
114120
ignore: true,
115121
should_panic: ShouldPanic::No,
116122
allow_fail: false,
123+
#[cfg(not(bootstrap))]
117124
compile_fail: false,
125+
#[cfg(not(bootstrap))]
118126
no_run: false,
119127
test_type: TestType::Unknown,
120128
},
@@ -139,7 +147,9 @@ fn test_should_panic() {
139147
ignore: false,
140148
should_panic: ShouldPanic::Yes,
141149
allow_fail: false,
150+
#[cfg(not(bootstrap))]
142151
compile_fail: false,
152+
#[cfg(not(bootstrap))]
143153
no_run: false,
144154
test_type: TestType::Unknown,
145155
},
@@ -164,7 +174,9 @@ fn test_should_panic_good_message() {
164174
ignore: false,
165175
should_panic: ShouldPanic::YesWithMessage("error message"),
166176
allow_fail: false,
177+
#[cfg(not(bootstrap))]
167178
compile_fail: false,
179+
#[cfg(not(bootstrap))]
168180
no_run: false,
169181
test_type: TestType::Unknown,
170182
},
@@ -194,7 +206,9 @@ fn test_should_panic_bad_message() {
194206
ignore: false,
195207
should_panic: ShouldPanic::YesWithMessage(expected),
196208
allow_fail: false,
209+
#[cfg(not(bootstrap))]
197210
compile_fail: false,
211+
#[cfg(not(bootstrap))]
198212
no_run: false,
199213
test_type: TestType::Unknown,
200214
},
@@ -228,7 +242,9 @@ fn test_should_panic_non_string_message_type() {
228242
ignore: false,
229243
should_panic: ShouldPanic::YesWithMessage(expected),
230244
allow_fail: false,
245+
#[cfg(not(bootstrap))]
231246
compile_fail: false,
247+
#[cfg(not(bootstrap))]
232248
no_run: false,
233249
test_type: TestType::Unknown,
234250
},
@@ -254,7 +270,9 @@ fn test_should_panic_but_succeeds() {
254270
ignore: false,
255271
should_panic,
256272
allow_fail: false,
273+
#[cfg(not(bootstrap))]
257274
compile_fail: false,
275+
#[cfg(not(bootstrap))]
258276
no_run: false,
259277
test_type: TestType::Unknown,
260278
},
@@ -288,7 +306,9 @@ fn report_time_test_template(report_time: bool) -> Option<TestExecTime> {
288306
ignore: false,
289307
should_panic: ShouldPanic::No,
290308
allow_fail: false,
309+
#[cfg(not(bootstrap))]
291310
compile_fail: false,
311+
#[cfg(not(bootstrap))]
292312
no_run: false,
293313
test_type: TestType::Unknown,
294314
},
@@ -323,7 +343,9 @@ fn time_test_failure_template(test_type: TestType) -> TestResult {
323343
ignore: false,
324344
should_panic: ShouldPanic::No,
325345
allow_fail: false,
346+
#[cfg(not(bootstrap))]
326347
compile_fail: false,
348+
#[cfg(not(bootstrap))]
327349
no_run: false,
328350
test_type,
329351
},
@@ -362,7 +384,9 @@ fn typed_test_desc(test_type: TestType) -> TestDesc {
362384
ignore: false,
363385
should_panic: ShouldPanic::No,
364386
allow_fail: false,
387+
#[cfg(not(bootstrap))]
365388
compile_fail: false,
389+
#[cfg(not(bootstrap))]
366390
no_run: false,
367391
test_type,
368392
}
@@ -475,7 +499,9 @@ pub fn exclude_should_panic_option() {
475499
ignore: false,
476500
should_panic: ShouldPanic::Yes,
477501
allow_fail: false,
502+
#[cfg(not(bootstrap))]
478503
compile_fail: false,
504+
#[cfg(not(bootstrap))]
479505
no_run: false,
480506
test_type: TestType::Unknown,
481507
},
@@ -499,7 +525,9 @@ pub fn exact_filter_match() {
499525
ignore: false,
500526
should_panic: ShouldPanic::No,
501527
allow_fail: false,
528+
#[cfg(not(bootstrap))]
502529
compile_fail: false,
530+
#[cfg(not(bootstrap))]
503531
no_run: false,
504532
test_type: TestType::Unknown,
505533
},
@@ -593,7 +621,9 @@ pub fn sort_tests() {
593621
ignore: false,
594622
should_panic: ShouldPanic::No,
595623
allow_fail: false,
624+
#[cfg(not(bootstrap))]
596625
compile_fail: false,
626+
#[cfg(not(bootstrap))]
597627
no_run: false,
598628
test_type: TestType::Unknown,
599629
},
@@ -672,7 +702,9 @@ pub fn test_bench_no_iter() {
672702
ignore: false,
673703
should_panic: ShouldPanic::No,
674704
allow_fail: false,
705+
#[cfg(not(bootstrap))]
675706
compile_fail: false,
707+
#[cfg(not(bootstrap))]
676708
no_run: false,
677709
test_type: TestType::Unknown,
678710
};
@@ -694,7 +726,9 @@ pub fn test_bench_iter() {
694726
ignore: false,
695727
should_panic: ShouldPanic::No,
696728
allow_fail: false,
729+
#[cfg(not(bootstrap))]
697730
compile_fail: false,
731+
#[cfg(not(bootstrap))]
698732
no_run: false,
699733
test_type: TestType::Unknown,
700734
};
@@ -710,7 +744,9 @@ fn should_sort_failures_before_printing_them() {
710744
ignore: false,
711745
should_panic: ShouldPanic::No,
712746
allow_fail: false,
747+
#[cfg(not(bootstrap))]
713748
compile_fail: false,
749+
#[cfg(not(bootstrap))]
714750
no_run: false,
715751
test_type: TestType::Unknown,
716752
};
@@ -720,7 +756,9 @@ fn should_sort_failures_before_printing_them() {
720756
ignore: false,
721757
should_panic: ShouldPanic::No,
722758
allow_fail: false,
759+
#[cfg(not(bootstrap))]
723760
compile_fail: false,
761+
#[cfg(not(bootstrap))]
724762
no_run: false,
725763
test_type: TestType::Unknown,
726764
};

library/test/src/types.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ pub struct TestDesc {
124124
pub ignore: bool,
125125
pub should_panic: options::ShouldPanic,
126126
pub allow_fail: bool,
127+
#[cfg(not(bootstrap))]
127128
pub compile_fail: bool,
129+
#[cfg(not(bootstrap))]
128130
pub no_run: bool,
129131
pub test_type: TestType,
130132
}
@@ -143,7 +145,8 @@ impl TestDesc {
143145
}
144146
}
145147

146-
pub fn test_mode_string(&self) -> &'static str {
148+
#[cfg(not(bootstrap))]
149+
pub fn test_mode(&self) -> &'static str {
147150
if self.ignore {
148151
return &"ignore";
149152
}
@@ -164,6 +167,11 @@ impl TestDesc {
164167
}
165168
&"run"
166169
}
170+
171+
#[cfg(bootstrap)]
172+
pub fn test_mode(&self) -> &'static str {
173+
&""
174+
}
167175
}
168176

169177
#[derive(Debug)]

src/librustdoc/doctest.rs

+2
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,9 @@ impl Tester for Collector {
935935
// compiler failures are test failures
936936
should_panic: testing::ShouldPanic::No,
937937
allow_fail: config.allow_fail,
938+
#[cfg(not(bootstrap))]
938939
compile_fail: config.compile_fail,
940+
#[cfg(not(bootstrap))]
939941
no_run,
940942
test_type: testing::TestType::DocTest,
941943
},

src/tools/compiletest/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,9 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
649649
ignore,
650650
should_panic,
651651
allow_fail: false,
652+
#[cfg(not(bootstrap))]
652653
compile_fail: false,
654+
#[cfg(not(bootstrap))]
653655
no_run: false,
654656
test_type: test::TestType::Unknown,
655657
},

0 commit comments

Comments
 (0)