Skip to content

Commit

Permalink
add compile_fail and no_run fields to TestDesc
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacrelf committed Aug 4, 2021
1 parent 0c12efa commit 96d0154
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,13 @@ fn render_files_test(desc: &FilesTestDesc, rendered: &mut Vec<TestDescAndFn>) {
let desc = TestDescAndFn {
desc: TestDesc {
name: TestName::DynTestName(test_name),
test_type: crate::test_type(desc.source_file),
ignore,
should_panic: ShouldPanic::No,
// Cannot be used on stable: https://github.com/rust-lang/rust/issues/46488
allow_fail: false,
test_type: crate::test_type(desc.source_file),
compile_fail: false,
no_run: false,
},
testfn,
};
Expand Down Expand Up @@ -218,10 +220,12 @@ fn render_data_test(desc: &DataTestDesc, rendered: &mut Vec<TestDescAndFn>) {
let desc = TestDescAndFn {
desc: TestDesc {
name: TestName::DynTestName(case_name),
test_type: crate::test_type(desc.source_file),
ignore: desc.ignore,
should_panic: ShouldPanic::No,
allow_fail: false,
test_type: crate::test_type(desc.source_file),
compile_fail: false,
no_run: false,
},
testfn,
};
Expand Down Expand Up @@ -402,11 +406,14 @@ fn render_test_descriptor(
rendered.push(TestDescAndFn {
desc: TestDesc {
name: TestName::StaticTestName(real_name(desc.name)),
test_type: crate::test_type(desc.source_file),
ignore: desc.ignore,
should_panic: desc.should_panic.into(),
// FIXME: should support!
// FIXME: should support, via a similar mechanism to `ignore`.
allow_fail: false,
test_type: crate::test_type(desc.source_file),
// These two are irrelevant for datatest, they only really make sense for doctests.
compile_fail: false,
no_run: false,
},
testfn: TestFn::StaticTestFn(desc.testfn),
})
Expand Down

0 comments on commit 96d0154

Please sign in to comment.