Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #81423

Closed
wants to merge 23 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b43aa96
Print failure message on all tests that should panic, but don't
johanngan Jan 10, 2021
2624b3e
Improve diagnostics for Precise Capture
ChrisPardy Nov 23, 2020
3056dd0
fix tidy
ChrisPardy Jan 16, 2021
b8115b8
fix line numbers
ChrisPardy Jan 16, 2021
bb4f70c
Avoid describing a method as 'not found' when bounds are unsatisfied
Aaron1011 Sep 26, 2020
63a1eee
Reset LateContext enclosing body in nested items
camsteffen Jan 18, 2021
21fb586
Query for TypeckResults in LateContext::qpath_res
camsteffen Jan 18, 2021
eaba3da
Remove qpath_res util function
camsteffen Jan 18, 2021
9abcfa5
Don't link with --export-dynamic on wasm32-wasi
sunfishcode Jan 21, 2021
e25959b
Make more traits of the From/Into family diagnostic items
flip1995 Jan 22, 2021
26b4baf
Point to span of upvar making closure FnMut
sledgehammervampire Jan 18, 2021
cf71d83
add tests
ChrisPardy Jan 26, 2021
cdcf92f
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
alexcrichton Nov 30, 2020
2e846d6
Point only at generic arguments when they are unexpected
estebank Dec 1, 2020
a67e6f9
Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3
Dylan-DPC Jan 27, 2021
ccbd311
Rollup merge of #79591 - estebank:unexpected-generics, r=oli-obk
Dylan-DPC Jan 27, 2021
f37d9d0
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…
Dylan-DPC Jan 27, 2021
8879a90
Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=n…
Dylan-DPC Jan 27, 2021
bd8896c
Rollup merge of #81149 - Aaron1011:feature/better-no-method-found-err…
Dylan-DPC Jan 27, 2021
37c692f
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
Dylan-DPC Jan 27, 2021
3436ad0
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
Dylan-DPC Jan 27, 2021
ad8244e
Rollup merge of #81255 - sunfishcode:wasi-no-export-dynamic, r=alexcr…
Dylan-DPC Jan 27, 2021
bfc6d88
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
Dylan-DPC Jan 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/test/src/test_result.rs
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ pub fn calc_result<'a>(
))
}
}
(&ShouldPanic::Yes, Ok(())) => {
(&ShouldPanic::Yes, Ok(())) | (&ShouldPanic::YesWithMessage(_), Ok(())) => {
TestResult::TrFailedMsg("test did not panic as expected".to_string())
}
_ if desc.allow_fail => TestResult::TrAllowedFail,
39 changes: 24 additions & 15 deletions library/test/src/tests.rs
Original file line number Diff line number Diff line change
@@ -228,21 +228,30 @@ fn test_should_panic_non_string_message_type() {
#[test]
#[cfg(not(target_os = "emscripten"))]
fn test_should_panic_but_succeeds() {
fn f() {}
let desc = TestDescAndFn {
desc: TestDesc {
name: StaticTestName("whatever"),
ignore: false,
should_panic: ShouldPanic::Yes,
allow_fail: false,
test_type: TestType::Unknown,
},
testfn: DynTestFn(Box::new(f)),
};
let (tx, rx) = channel();
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
let result = rx.recv().unwrap().result;
assert_eq!(result, TrFailedMsg("test did not panic as expected".to_string()));
let should_panic_variants = [ShouldPanic::Yes, ShouldPanic::YesWithMessage("error message")];

for &should_panic in should_panic_variants.iter() {
fn f() {}
let desc = TestDescAndFn {
desc: TestDesc {
name: StaticTestName("whatever"),
ignore: false,
should_panic,
allow_fail: false,
test_type: TestType::Unknown,
},
testfn: DynTestFn(Box::new(f)),
};
let (tx, rx) = channel();
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
let result = rx.recv().unwrap().result;
assert_eq!(
result,
TrFailedMsg("test did not panic as expected".to_string()),
"should_panic == {:?}",
should_panic
);
}
}

fn report_time_test_template(report_time: bool) -> Option<TestExecTime> {