Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-se
remove `allow_fail` test flag close #93345
This commit is contained in:
commit
252ff5ead0
25 changed files with 86 additions and 277 deletions
|
@ -252,11 +252,6 @@ pub fn expand_test_or_bench(
|
||||||
"ignore",
|
"ignore",
|
||||||
cx.expr_bool(sp, should_ignore(&cx.sess, &item)),
|
cx.expr_bool(sp, should_ignore(&cx.sess, &item)),
|
||||||
),
|
),
|
||||||
// allow_fail: true | false
|
|
||||||
field(
|
|
||||||
"allow_fail",
|
|
||||||
cx.expr_bool(sp, should_fail(&cx.sess, &item)),
|
|
||||||
),
|
|
||||||
// compile_fail: true | false
|
// compile_fail: true | false
|
||||||
field("compile_fail", cx.expr_bool(sp, false)),
|
field("compile_fail", cx.expr_bool(sp, false)),
|
||||||
// no_run: true | false
|
// no_run: true | false
|
||||||
|
@ -359,10 +354,6 @@ fn should_ignore(sess: &Session, i: &ast::Item) -> bool {
|
||||||
sess.contains_name(&i.attrs, sym::ignore)
|
sess.contains_name(&i.attrs, sym::ignore)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn should_fail(sess: &Session, i: &ast::Item) -> bool {
|
|
||||||
sess.contains_name(&i.attrs, sym::allow_fail)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
|
fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
|
||||||
match cx.sess.find_by_name(&i.attrs, sym::should_panic) {
|
match cx.sess.find_by_name(&i.attrs, sym::should_panic) {
|
||||||
Some(attr) => {
|
Some(attr) => {
|
||||||
|
|
|
@ -277,8 +277,6 @@ declare_features! (
|
||||||
(incomplete, adt_const_params, "1.56.0", Some(44580), None),
|
(incomplete, adt_const_params, "1.56.0", Some(44580), None),
|
||||||
/// Allows defining an `#[alloc_error_handler]`.
|
/// Allows defining an `#[alloc_error_handler]`.
|
||||||
(active, alloc_error_handler, "1.29.0", Some(51540), None),
|
(active, alloc_error_handler, "1.29.0", Some(51540), None),
|
||||||
/// Allows a test to fail without failing the whole suite.
|
|
||||||
(active, allow_fail, "1.19.0", Some(46488), None),
|
|
||||||
/// Allows explicit discriminants on non-unit enum variants.
|
/// Allows explicit discriminants on non-unit enum variants.
|
||||||
(active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None),
|
(active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None),
|
||||||
/// Allows trait methods with arbitrary self types.
|
/// Allows trait methods with arbitrary self types.
|
||||||
|
|
|
@ -403,7 +403,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
},
|
},
|
||||||
|
|
||||||
// Testing:
|
// Testing:
|
||||||
gated!(allow_fail, Normal, template!(Word), WarnFollowing, experimental!(allow_fail)),
|
|
||||||
gated!(
|
gated!(
|
||||||
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
|
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
|
||||||
"custom test frameworks are an unstable feature",
|
"custom test frameworks are an unstable feature",
|
||||||
|
|
|
@ -48,6 +48,8 @@ declare_features! (
|
||||||
(removed, advanced_slice_patterns, "1.0.0", Some(62254), None,
|
(removed, advanced_slice_patterns, "1.0.0", Some(62254), None,
|
||||||
Some("merged into `#![feature(slice_patterns)]`")),
|
Some("merged into `#![feature(slice_patterns)]`")),
|
||||||
(removed, allocator, "1.0.0", None, None, None),
|
(removed, allocator, "1.0.0", None, None, None),
|
||||||
|
/// Allows a test to fail without failing the whole suite.
|
||||||
|
(removed, allow_fail, "1.19.0", Some(46488), None, Some("removed due to no clear use cases")),
|
||||||
(removed, await_macro, "1.38.0", Some(50547), None,
|
(removed, await_macro, "1.38.0", Some(50547), None,
|
||||||
Some("subsumed by `.await` syntax")),
|
Some("subsumed by `.await` syntax")),
|
||||||
/// Allows comparing raw pointers during const eval.
|
/// Allows comparing raw pointers during const eval.
|
||||||
|
|
|
@ -47,7 +47,6 @@ pub struct ConsoleTestState {
|
||||||
pub passed: usize,
|
pub passed: usize,
|
||||||
pub failed: usize,
|
pub failed: usize,
|
||||||
pub ignored: usize,
|
pub ignored: usize,
|
||||||
pub allowed_fail: usize,
|
|
||||||
pub filtered_out: usize,
|
pub filtered_out: usize,
|
||||||
pub measured: usize,
|
pub measured: usize,
|
||||||
pub exec_time: Option<TestSuiteExecTime>,
|
pub exec_time: Option<TestSuiteExecTime>,
|
||||||
|
@ -71,7 +70,6 @@ impl ConsoleTestState {
|
||||||
passed: 0,
|
passed: 0,
|
||||||
failed: 0,
|
failed: 0,
|
||||||
ignored: 0,
|
ignored: 0,
|
||||||
allowed_fail: 0,
|
|
||||||
filtered_out: 0,
|
filtered_out: 0,
|
||||||
measured: 0,
|
measured: 0,
|
||||||
exec_time: None,
|
exec_time: None,
|
||||||
|
@ -112,7 +110,6 @@ impl ConsoleTestState {
|
||||||
TestResult::TrFailed => "failed".to_owned(),
|
TestResult::TrFailed => "failed".to_owned(),
|
||||||
TestResult::TrFailedMsg(ref msg) => format!("failed: {}", msg),
|
TestResult::TrFailedMsg(ref msg) => format!("failed: {}", msg),
|
||||||
TestResult::TrIgnored => "ignored".to_owned(),
|
TestResult::TrIgnored => "ignored".to_owned(),
|
||||||
TestResult::TrAllowedFail => "failed (allowed)".to_owned(),
|
|
||||||
TestResult::TrBench(ref bs) => fmt_bench_samples(bs),
|
TestResult::TrBench(ref bs) => fmt_bench_samples(bs),
|
||||||
TestResult::TrTimedFail => "failed (time limit exceeded)".to_owned(),
|
TestResult::TrTimedFail => "failed (time limit exceeded)".to_owned(),
|
||||||
},
|
},
|
||||||
|
@ -126,7 +123,7 @@ impl ConsoleTestState {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_test_count(&self) -> usize {
|
fn current_test_count(&self) -> usize {
|
||||||
self.passed + self.failed + self.ignored + self.measured + self.allowed_fail
|
self.passed + self.failed + self.ignored + self.measured
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +188,6 @@ fn handle_test_result(st: &mut ConsoleTestState, completed_test: CompletedTest)
|
||||||
st.not_failures.push((test, stdout));
|
st.not_failures.push((test, stdout));
|
||||||
}
|
}
|
||||||
TestResult::TrIgnored => st.ignored += 1,
|
TestResult::TrIgnored => st.ignored += 1,
|
||||||
TestResult::TrAllowedFail => st.allowed_fail += 1,
|
|
||||||
TestResult::TrBench(bs) => {
|
TestResult::TrBench(bs) => {
|
||||||
st.metrics.insert_metric(
|
st.metrics.insert_metric(
|
||||||
test.name.as_slice(),
|
test.name.as_slice(),
|
||||||
|
|
|
@ -124,15 +124,6 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
|
||||||
self.write_event("test", desc.name.as_slice(), "ignored", exec_time, stdout, None)
|
self.write_event("test", desc.name.as_slice(), "ignored", exec_time, stdout, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
TestResult::TrAllowedFail => self.write_event(
|
|
||||||
"test",
|
|
||||||
desc.name.as_slice(),
|
|
||||||
"allowed_failure",
|
|
||||||
exec_time,
|
|
||||||
stdout,
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
|
|
||||||
TestResult::TrBench(ref bs) => {
|
TestResult::TrBench(ref bs) => {
|
||||||
let median = bs.ns_iter_summ.median as usize;
|
let median = bs.ns_iter_summ.median as usize;
|
||||||
let deviation = (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize;
|
let deviation = (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize;
|
||||||
|
@ -172,14 +163,12 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
|
||||||
\"event\": \"{}\", \
|
\"event\": \"{}\", \
|
||||||
\"passed\": {}, \
|
\"passed\": {}, \
|
||||||
\"failed\": {}, \
|
\"failed\": {}, \
|
||||||
\"allowed_fail\": {}, \
|
|
||||||
\"ignored\": {}, \
|
\"ignored\": {}, \
|
||||||
\"measured\": {}, \
|
\"measured\": {}, \
|
||||||
\"filtered_out\": {}",
|
\"filtered_out\": {}",
|
||||||
if state.failed == 0 { "ok" } else { "failed" },
|
if state.failed == 0 { "ok" } else { "failed" },
|
||||||
state.passed,
|
state.passed,
|
||||||
state.failed + state.allowed_fail,
|
state.failed,
|
||||||
state.allowed_fail,
|
|
||||||
state.ignored,
|
state.ignored,
|
||||||
state.measured,
|
state.measured,
|
||||||
state.filtered_out,
|
state.filtered_out,
|
||||||
|
|
|
@ -121,7 +121,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
|
||||||
))?;
|
))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestResult::TrOk | TestResult::TrAllowedFail => {
|
TestResult::TrOk => {
|
||||||
self.write_message(&*format!(
|
self.write_message(&*format!(
|
||||||
"<testcase classname=\"{}\" \
|
"<testcase classname=\"{}\" \
|
||||||
name=\"{}\" time=\"{}\"/>",
|
name=\"{}\" time=\"{}\"/>",
|
||||||
|
|
|
@ -49,10 +49,6 @@ impl<T: Write> PrettyFormatter<T> {
|
||||||
self.write_short_result("ignored", term::color::YELLOW)
|
self.write_short_result("ignored", term::color::YELLOW)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_allowed_fail(&mut self) -> io::Result<()> {
|
|
||||||
self.write_short_result("FAILED (allowed)", term::color::YELLOW)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn write_time_failed(&mut self) -> io::Result<()> {
|
pub fn write_time_failed(&mut self) -> io::Result<()> {
|
||||||
self.write_short_result("FAILED (time limit exceeded)", term::color::RED)
|
self.write_short_result("FAILED (time limit exceeded)", term::color::RED)
|
||||||
}
|
}
|
||||||
|
@ -219,7 +215,6 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
|
||||||
TestResult::TrOk => self.write_ok()?,
|
TestResult::TrOk => self.write_ok()?,
|
||||||
TestResult::TrFailed | TestResult::TrFailedMsg(_) => self.write_failed()?,
|
TestResult::TrFailed | TestResult::TrFailedMsg(_) => self.write_failed()?,
|
||||||
TestResult::TrIgnored => self.write_ignored()?,
|
TestResult::TrIgnored => self.write_ignored()?,
|
||||||
TestResult::TrAllowedFail => self.write_allowed_fail()?,
|
|
||||||
TestResult::TrBench(ref bs) => {
|
TestResult::TrBench(ref bs) => {
|
||||||
self.write_bench()?;
|
self.write_bench()?;
|
||||||
self.write_plain(&format!(": {}", fmt_bench_samples(bs)))?;
|
self.write_plain(&format!(": {}", fmt_bench_samples(bs)))?;
|
||||||
|
@ -263,22 +258,10 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
|
||||||
self.write_pretty("FAILED", term::color::RED)?;
|
self.write_pretty("FAILED", term::color::RED)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let s = if state.allowed_fail > 0 {
|
let s = format!(
|
||||||
format!(
|
|
||||||
". {} passed; {} failed ({} allowed); {} ignored; {} measured; {} filtered out",
|
|
||||||
state.passed,
|
|
||||||
state.failed + state.allowed_fail,
|
|
||||||
state.allowed_fail,
|
|
||||||
state.ignored,
|
|
||||||
state.measured,
|
|
||||||
state.filtered_out
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
format!(
|
|
||||||
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
|
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
|
||||||
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
|
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
|
||||||
)
|
);
|
||||||
};
|
|
||||||
|
|
||||||
self.write_plain(&s)?;
|
self.write_plain(&s)?;
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,6 @@ impl<T: Write> TerseFormatter<T> {
|
||||||
self.write_short_result("i", term::color::YELLOW)
|
self.write_short_result("i", term::color::YELLOW)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_allowed_fail(&mut self) -> io::Result<()> {
|
|
||||||
self.write_short_result("a", term::color::YELLOW)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn write_bench(&mut self) -> io::Result<()> {
|
pub fn write_bench(&mut self) -> io::Result<()> {
|
||||||
self.write_pretty("bench", term::color::CYAN)
|
self.write_pretty("bench", term::color::CYAN)
|
||||||
}
|
}
|
||||||
|
@ -207,7 +203,6 @@ impl<T: Write> OutputFormatter for TerseFormatter<T> {
|
||||||
self.write_failed()
|
self.write_failed()
|
||||||
}
|
}
|
||||||
TestResult::TrIgnored => self.write_ignored(),
|
TestResult::TrIgnored => self.write_ignored(),
|
||||||
TestResult::TrAllowedFail => self.write_allowed_fail(),
|
|
||||||
TestResult::TrBench(ref bs) => {
|
TestResult::TrBench(ref bs) => {
|
||||||
if self.is_multithreaded {
|
if self.is_multithreaded {
|
||||||
self.write_test_name(desc)?;
|
self.write_test_name(desc)?;
|
||||||
|
@ -244,22 +239,10 @@ impl<T: Write> OutputFormatter for TerseFormatter<T> {
|
||||||
self.write_pretty("FAILED", term::color::RED)?;
|
self.write_pretty("FAILED", term::color::RED)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let s = if state.allowed_fail > 0 {
|
let s = format!(
|
||||||
format!(
|
|
||||||
". {} passed; {} failed ({} allowed); {} ignored; {} measured; {} filtered out",
|
|
||||||
state.passed,
|
|
||||||
state.failed + state.allowed_fail,
|
|
||||||
state.allowed_fail,
|
|
||||||
state.ignored,
|
|
||||||
state.measured,
|
|
||||||
state.filtered_out
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
format!(
|
|
||||||
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
|
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
|
||||||
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
|
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
|
||||||
)
|
);
|
||||||
};
|
|
||||||
|
|
||||||
self.write_plain(&s)?;
|
self.write_plain(&s)?;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ pub enum TestResult {
|
||||||
TrFailed,
|
TrFailed,
|
||||||
TrFailedMsg(String),
|
TrFailedMsg(String),
|
||||||
TrIgnored,
|
TrIgnored,
|
||||||
TrAllowedFail,
|
|
||||||
TrBench(BenchSamples),
|
TrBench(BenchSamples),
|
||||||
TrTimedFail,
|
TrTimedFail,
|
||||||
}
|
}
|
||||||
|
@ -42,8 +41,6 @@ pub fn calc_result<'a>(
|
||||||
|
|
||||||
if maybe_panic_str.map(|e| e.contains(msg)).unwrap_or(false) {
|
if maybe_panic_str.map(|e| e.contains(msg)).unwrap_or(false) {
|
||||||
TestResult::TrOk
|
TestResult::TrOk
|
||||||
} else if desc.allow_fail {
|
|
||||||
TestResult::TrAllowedFail
|
|
||||||
} else if let Some(panic_str) = maybe_panic_str {
|
} else if let Some(panic_str) = maybe_panic_str {
|
||||||
TestResult::TrFailedMsg(format!(
|
TestResult::TrFailedMsg(format!(
|
||||||
r#"panic did not contain expected string
|
r#"panic did not contain expected string
|
||||||
|
@ -64,7 +61,6 @@ pub fn calc_result<'a>(
|
||||||
(&ShouldPanic::Yes, Ok(())) | (&ShouldPanic::YesWithMessage(_), Ok(())) => {
|
(&ShouldPanic::Yes, Ok(())) | (&ShouldPanic::YesWithMessage(_), Ok(())) => {
|
||||||
TestResult::TrFailedMsg("test did not panic as expected".to_string())
|
TestResult::TrFailedMsg("test did not panic as expected".to_string())
|
||||||
}
|
}
|
||||||
_ if desc.allow_fail => TestResult::TrAllowedFail,
|
|
||||||
_ => TestResult::TrFailed,
|
_ => TestResult::TrFailed,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,11 +86,10 @@ pub fn get_result_from_exit_code(
|
||||||
time_opts: &Option<time::TestTimeOptions>,
|
time_opts: &Option<time::TestTimeOptions>,
|
||||||
exec_time: &Option<time::TestExecTime>,
|
exec_time: &Option<time::TestExecTime>,
|
||||||
) -> TestResult {
|
) -> TestResult {
|
||||||
let result = match (desc.allow_fail, code) {
|
let result = match code {
|
||||||
(_, TR_OK) => TestResult::TrOk,
|
TR_OK => TestResult::TrOk,
|
||||||
(true, TR_FAILED) => TestResult::TrAllowedFail,
|
TR_FAILED => TestResult::TrFailed,
|
||||||
(false, TR_FAILED) => TestResult::TrFailed,
|
_ => TestResult::TrFailedMsg(format!("got unexpected return code {}", code)),
|
||||||
(_, _) => TestResult::TrFailedMsg(format!("got unexpected return code {}", code)),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// If test is already failed (or allowed to fail), do not change the result.
|
// If test is already failed (or allowed to fail), do not change the result.
|
||||||
|
|
|
@ -62,10 +62,11 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
|
||||||
name: StaticTestName("1"),
|
name: StaticTestName("1"),
|
||||||
ignore: true,
|
ignore: true,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(move || {})),
|
testfn: DynTestFn(Box::new(move || {})),
|
||||||
},
|
},
|
||||||
|
@ -74,10 +75,11 @@ fn one_ignored_one_unignored_test() -> Vec<TestDescAndFn> {
|
||||||
name: StaticTestName("2"),
|
name: StaticTestName("2"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(move || {})),
|
testfn: DynTestFn(Box::new(move || {})),
|
||||||
},
|
},
|
||||||
|
@ -94,10 +96,11 @@ pub fn do_not_run_ignored_tests() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: true,
|
ignore: true,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -115,10 +118,11 @@ pub fn ignored_tests_result_in_ignored() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: true,
|
ignore: true,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -140,10 +144,11 @@ fn test_should_panic() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::Yes,
|
should_panic: ShouldPanic::Yes,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -165,10 +170,11 @@ fn test_should_panic_good_message() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::YesWithMessage("error message"),
|
should_panic: ShouldPanic::YesWithMessage("error message"),
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -195,10 +201,11 @@ fn test_should_panic_bad_message() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::YesWithMessage(expected),
|
should_panic: ShouldPanic::YesWithMessage(expected),
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -229,10 +236,11 @@ fn test_should_panic_non_string_message_type() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::YesWithMessage(expected),
|
should_panic: ShouldPanic::YesWithMessage(expected),
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -255,10 +263,11 @@ fn test_should_panic_but_succeeds() {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic,
|
should_panic,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -289,10 +298,11 @@ fn report_time_test_template(report_time: bool) -> Option<TestExecTime> {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -324,10 +334,11 @@ fn time_test_failure_template(test_type: TestType) -> TestResult {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type,
|
test_type,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(f)),
|
testfn: DynTestFn(Box::new(f)),
|
||||||
};
|
};
|
||||||
|
@ -363,10 +374,11 @@ fn typed_test_desc(test_type: TestType) -> TestDesc {
|
||||||
name: StaticTestName("whatever"),
|
name: StaticTestName("whatever"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type,
|
test_type,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,10 +488,11 @@ pub fn exclude_should_panic_option() {
|
||||||
name: StaticTestName("3"),
|
name: StaticTestName("3"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::Yes,
|
should_panic: ShouldPanic::Yes,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(move || {})),
|
testfn: DynTestFn(Box::new(move || {})),
|
||||||
});
|
});
|
||||||
|
@ -500,10 +513,11 @@ pub fn exact_filter_match() {
|
||||||
name: StaticTestName(name),
|
name: StaticTestName(name),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(move || {})),
|
testfn: DynTestFn(Box::new(move || {})),
|
||||||
})
|
})
|
||||||
|
@ -589,10 +603,11 @@ fn sample_tests() -> Vec<TestDescAndFn> {
|
||||||
name: DynTestName((*name).clone()),
|
name: DynTestName((*name).clone()),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: DynTestFn(Box::new(testfn)),
|
testfn: DynTestFn(Box::new(testfn)),
|
||||||
};
|
};
|
||||||
|
@ -740,10 +755,11 @@ pub fn test_bench_no_iter() {
|
||||||
name: StaticTestName("f"),
|
name: StaticTestName("f"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
crate::bench::benchmark(TestId(0), desc, tx, true, f);
|
crate::bench::benchmark(TestId(0), desc, tx, true, f);
|
||||||
|
@ -762,10 +778,11 @@ pub fn test_bench_iter() {
|
||||||
name: StaticTestName("f"),
|
name: StaticTestName("f"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
crate::bench::benchmark(TestId(0), desc, tx, true, f);
|
crate::bench::benchmark(TestId(0), desc, tx, true, f);
|
||||||
|
@ -778,20 +795,22 @@ fn should_sort_failures_before_printing_them() {
|
||||||
name: StaticTestName("a"),
|
name: StaticTestName("a"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let test_b = TestDesc {
|
let test_b = TestDesc {
|
||||||
name: StaticTestName("b"),
|
name: StaticTestName("b"),
|
||||||
ignore: false,
|
ignore: false,
|
||||||
should_panic: ShouldPanic::No,
|
should_panic: ShouldPanic::No,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: TestType::Unknown,
|
test_type: TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut out = PrettyFormatter::new(OutputLocation::Raw(Vec::new()), false, 10, false, None);
|
let mut out = PrettyFormatter::new(OutputLocation::Raw(Vec::new()), false, 10, false, None);
|
||||||
|
@ -802,7 +821,6 @@ fn should_sort_failures_before_printing_them() {
|
||||||
passed: 0,
|
passed: 0,
|
||||||
failed: 0,
|
failed: 0,
|
||||||
ignored: 0,
|
ignored: 0,
|
||||||
allowed_fail: 0,
|
|
||||||
filtered_out: 0,
|
filtered_out: 0,
|
||||||
measured: 0,
|
measured: 0,
|
||||||
exec_time: None,
|
exec_time: None,
|
||||||
|
|
|
@ -118,10 +118,11 @@ pub struct TestDesc {
|
||||||
pub name: TestName,
|
pub name: TestName,
|
||||||
pub ignore: bool,
|
pub ignore: bool,
|
||||||
pub should_panic: options::ShouldPanic,
|
pub should_panic: options::ShouldPanic,
|
||||||
pub allow_fail: bool,
|
|
||||||
pub compile_fail: bool,
|
pub compile_fail: bool,
|
||||||
pub no_run: bool,
|
pub no_run: bool,
|
||||||
pub test_type: TestType,
|
pub test_type: TestType,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
pub allow_fail: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestDesc {
|
impl TestDesc {
|
||||||
|
@ -150,9 +151,6 @@ impl TestDesc {
|
||||||
}
|
}
|
||||||
options::ShouldPanic::No => {}
|
options::ShouldPanic::No => {}
|
||||||
}
|
}
|
||||||
if self.allow_fail {
|
|
||||||
return Some("allow fail");
|
|
||||||
}
|
|
||||||
if self.compile_fail {
|
if self.compile_fail {
|
||||||
return Some("compile fail");
|
return Some("compile fail");
|
||||||
}
|
}
|
||||||
|
|
|
@ -951,10 +951,11 @@ impl Tester for Collector {
|
||||||
},
|
},
|
||||||
// compiler failures are test failures
|
// compiler failures are test failures
|
||||||
should_panic: test::ShouldPanic::No,
|
should_panic: test::ShouldPanic::No,
|
||||||
allow_fail: config.allow_fail,
|
|
||||||
compile_fail: config.compile_fail,
|
compile_fail: config.compile_fail,
|
||||||
no_run,
|
no_run,
|
||||||
test_type: test::TestType::DocTest,
|
test_type: test::TestType::DocTest,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
},
|
},
|
||||||
testfn: test::DynTestFn(box move || {
|
testfn: test::DynTestFn(box move || {
|
||||||
let report_unused_externs = |uext| {
|
let report_unused_externs = |uext| {
|
||||||
|
|
|
@ -847,7 +847,6 @@ crate struct LangString {
|
||||||
crate test_harness: bool,
|
crate test_harness: bool,
|
||||||
crate compile_fail: bool,
|
crate compile_fail: bool,
|
||||||
crate error_codes: Vec<String>,
|
crate error_codes: Vec<String>,
|
||||||
crate allow_fail: bool,
|
|
||||||
crate edition: Option<Edition>,
|
crate edition: Option<Edition>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +868,6 @@ impl Default for LangString {
|
||||||
test_harness: false,
|
test_harness: false,
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
error_codes: Vec::new(),
|
error_codes: Vec::new(),
|
||||||
allow_fail: false,
|
|
||||||
edition: None,
|
edition: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -943,10 +941,6 @@ impl LangString {
|
||||||
seen_rust_tags = !seen_other_tags;
|
seen_rust_tags = !seen_other_tags;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"allow_fail" => {
|
|
||||||
data.allow_fail = true;
|
|
||||||
seen_rust_tags = !seen_other_tags;
|
|
||||||
}
|
|
||||||
"rust" => {
|
"rust" => {
|
||||||
data.rust = true;
|
data.rust = true;
|
||||||
seen_rust_tags = true;
|
seen_rust_tags = true;
|
||||||
|
@ -994,12 +988,6 @@ impl LangString {
|
||||||
"the code block will either not be tested if not marked as a rust one \
|
"the code block will either not be tested if not marked as a rust one \
|
||||||
or will be run (which you might not want)",
|
or will be run (which you might not want)",
|
||||||
))
|
))
|
||||||
} else if s == "allow-fail" || s == "allow_fail" || s == "allowfail" {
|
|
||||||
Some((
|
|
||||||
"allow_fail",
|
|
||||||
"the code block will either not be tested if not marked as a rust one \
|
|
||||||
or will be run (which you might not want)",
|
|
||||||
))
|
|
||||||
} else if s == "test-harness" || s == "test_harness" || s == "testharness" {
|
} else if s == "test-harness" || s == "test_harness" || s == "testharness" {
|
||||||
Some((
|
Some((
|
||||||
"test_harness",
|
"test_harness",
|
||||||
|
|
|
@ -70,7 +70,6 @@ fn test_lang_string_parse() {
|
||||||
compile_fail: true,
|
compile_fail: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
t(LangString { original: "allow_fail".into(), allow_fail: true, ..Default::default() });
|
|
||||||
t(LangString { original: "no_run,example".into(), no_run: true, ..Default::default() });
|
t(LangString { original: "no_run,example".into(), no_run: true, ..Default::default() });
|
||||||
t(LangString {
|
t(LangString {
|
||||||
original: "sh,should_panic".into(),
|
original: "sh,should_panic".into(),
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
{ "type": "test", "name": "c", "event": "ok" }
|
{ "type": "test", "name": "c", "event": "ok" }
|
||||||
{ "type": "test", "event": "started", "name": "d" }
|
{ "type": "test", "event": "started", "name": "d" }
|
||||||
{ "type": "test", "name": "d", "event": "ignored" }
|
{ "type": "test", "name": "d", "event": "ignored" }
|
||||||
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "allowed_fail": 0, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
|
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:15:5\n" }
|
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:15:5\n" }
|
||||||
{ "type": "test", "event": "started", "name": "d" }
|
{ "type": "test", "event": "started", "name": "d" }
|
||||||
{ "type": "test", "name": "d", "event": "ignored" }
|
{ "type": "test", "name": "d", "event": "ignored" }
|
||||||
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "allowed_fail": 0, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
|
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
|
||||||
|
|
|
@ -23,13 +23,6 @@ pub fn bar() {}
|
||||||
/// ```
|
/// ```
|
||||||
pub fn foobar() {}
|
pub fn foobar() {}
|
||||||
|
|
||||||
/// barfoo
|
|
||||||
///
|
|
||||||
/// ```allow-fail,allowfail,allOw_fail
|
|
||||||
/// boo
|
|
||||||
/// ```
|
|
||||||
pub fn barfoo() {}
|
|
||||||
|
|
||||||
/// b
|
/// b
|
||||||
///
|
///
|
||||||
/// ```test-harness,testharness,tesT_harness
|
/// ```test-harness,testharness,tesT_harness
|
||||||
|
|
|
@ -111,77 +111,41 @@ error: unknown attribute `nO_run`. Did you mean `no_run`?
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
||||||
|
|
||||||
error: unknown attribute `allow-fail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr-test.rs:26:1
|
|
||||||
|
|
|
||||||
26 | / /// barfoo
|
|
||||||
27 | | ///
|
|
||||||
28 | | /// ```allow-fail,allowfail,allOw_fail
|
|
||||||
29 | | /// boo
|
|
||||||
30 | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `allowfail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr-test.rs:26:1
|
|
||||||
|
|
|
||||||
26 | / /// barfoo
|
|
||||||
27 | | ///
|
|
||||||
28 | | /// ```allow-fail,allowfail,allOw_fail
|
|
||||||
29 | | /// boo
|
|
||||||
30 | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `allOw_fail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr-test.rs:26:1
|
|
||||||
|
|
|
||||||
26 | / /// barfoo
|
|
||||||
27 | | ///
|
|
||||||
28 | | /// ```allow-fail,allowfail,allOw_fail
|
|
||||||
29 | | /// boo
|
|
||||||
30 | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `test-harness`. Did you mean `test_harness`?
|
error: unknown attribute `test-harness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr-test.rs:33:1
|
--> $DIR/check-attr-test.rs:26:1
|
||||||
|
|
|
|
||||||
33 | / /// b
|
26 | / /// b
|
||||||
34 | | ///
|
27 | | ///
|
||||||
35 | | /// ```test-harness,testharness,tesT_harness
|
28 | | /// ```test-harness,testharness,tesT_harness
|
||||||
36 | | /// boo
|
29 | | /// boo
|
||||||
37 | | /// ```
|
30 | | /// ```
|
||||||
| |_______^
|
| |_______^
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: unknown attribute `testharness`. Did you mean `test_harness`?
|
error: unknown attribute `testharness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr-test.rs:33:1
|
--> $DIR/check-attr-test.rs:26:1
|
||||||
|
|
|
|
||||||
33 | / /// b
|
26 | / /// b
|
||||||
34 | | ///
|
27 | | ///
|
||||||
35 | | /// ```test-harness,testharness,tesT_harness
|
28 | | /// ```test-harness,testharness,tesT_harness
|
||||||
36 | | /// boo
|
29 | | /// boo
|
||||||
37 | | /// ```
|
30 | | /// ```
|
||||||
| |_______^
|
| |_______^
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: unknown attribute `tesT_harness`. Did you mean `test_harness`?
|
error: unknown attribute `tesT_harness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr-test.rs:33:1
|
--> $DIR/check-attr-test.rs:26:1
|
||||||
|
|
|
|
||||||
33 | / /// b
|
26 | / /// b
|
||||||
34 | | ///
|
27 | | ///
|
||||||
35 | | /// ```test-harness,testharness,tesT_harness
|
28 | | /// ```test-harness,testharness,tesT_harness
|
||||||
36 | | /// boo
|
29 | | /// boo
|
||||||
37 | | /// ```
|
30 | | /// ```
|
||||||
| |_______^
|
| |_______^
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: aborting due to 15 previous errors
|
error: aborting due to 12 previous errors
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,6 @@ pub fn bar() {}
|
||||||
/// ```
|
/// ```
|
||||||
pub fn foobar() {}
|
pub fn foobar() {}
|
||||||
|
|
||||||
/// barfoo
|
|
||||||
//~^ ERROR
|
|
||||||
//~^^ ERROR
|
|
||||||
//~^^^ ERROR
|
|
||||||
///
|
|
||||||
/// ```allow-fail,allowfail,alLow_fail
|
|
||||||
/// boo
|
|
||||||
/// ```
|
|
||||||
pub fn barfoo() {}
|
|
||||||
|
|
||||||
/// b
|
/// b
|
||||||
//~^ ERROR
|
//~^ ERROR
|
||||||
//~^^ ERROR
|
//~^^ ERROR
|
||||||
|
|
|
@ -129,50 +129,8 @@ LL | | /// ```
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
||||||
|
|
||||||
error: unknown attribute `allow-fail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr.rs:33:1
|
|
||||||
|
|
|
||||||
LL | / /// barfoo
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
|
||||||
LL | | /// boo
|
|
||||||
LL | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `allowfail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr.rs:33:1
|
|
||||||
|
|
|
||||||
LL | / /// barfoo
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
|
||||||
LL | | /// boo
|
|
||||||
LL | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `alLow_fail`. Did you mean `allow_fail`?
|
|
||||||
--> $DIR/check-attr.rs:33:1
|
|
||||||
|
|
|
||||||
LL | / /// barfoo
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
|
||||||
LL | | /// boo
|
|
||||||
LL | | /// ```
|
|
||||||
| |_______^
|
|
||||||
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or will be run (which you might not want)
|
|
||||||
|
|
||||||
error: unknown attribute `test-harness`. Did you mean `test_harness`?
|
error: unknown attribute `test-harness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr.rs:43:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
LL | |
|
||||||
|
@ -186,7 +144,7 @@ LL | | /// ```
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: unknown attribute `testharness`. Did you mean `test_harness`?
|
error: unknown attribute `testharness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr.rs:43:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
LL | |
|
||||||
|
@ -200,7 +158,7 @@ LL | | /// ```
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: unknown attribute `teSt_harness`. Did you mean `test_harness`?
|
error: unknown attribute `teSt_harness`. Did you mean `test_harness`?
|
||||||
--> $DIR/check-attr.rs:43:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
LL | |
|
||||||
|
@ -213,5 +171,5 @@ LL | | /// ```
|
||||||
|
|
|
|
||||||
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
|
||||||
|
|
||||||
error: aborting due to 15 previous errors
|
error: aborting due to 12 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
// check that #[allow_fail] is feature-gated
|
|
||||||
|
|
||||||
#[allow_fail] //~ ERROR the `#[allow_fail]` attribute is an experimental feature
|
|
||||||
fn ok_to_fail() {
|
|
||||||
assert!(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
|
@ -1,12 +0,0 @@
|
||||||
error[E0658]: the `#[allow_fail]` attribute is an experimental feature
|
|
||||||
--> $DIR/feature-gate-allow_fail.rs:3:1
|
|
||||||
|
|
|
||||||
LL | #[allow_fail]
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: see issue #46488 <https://github.com/rust-lang/rust/issues/46488> for more information
|
|
||||||
= help: add `#![feature(allow_fail)]` to the crate attributes to enable
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0658`.
|
|
|
@ -1,17 +0,0 @@
|
||||||
// run-pass
|
|
||||||
// compile-flags: --test
|
|
||||||
#![feature(allow_fail)]
|
|
||||||
#![feature(cfg_panic)]
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[allow_fail]
|
|
||||||
fn test1() {
|
|
||||||
#[cfg(not(panic = "abort"))]
|
|
||||||
panic!();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[allow_fail]
|
|
||||||
fn test2() {
|
|
||||||
assert!(true);
|
|
||||||
}
|
|
|
@ -922,10 +922,11 @@ pub fn make_test_description<R: Read>(
|
||||||
name,
|
name,
|
||||||
ignore,
|
ignore,
|
||||||
should_panic,
|
should_panic,
|
||||||
allow_fail: false,
|
|
||||||
compile_fail: false,
|
compile_fail: false,
|
||||||
no_run: false,
|
no_run: false,
|
||||||
test_type: test::TestType::Unknown,
|
test_type: test::TestType::Unknown,
|
||||||
|
#[cfg(bootstrap)]
|
||||||
|
allow_fail: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue