Closed
Description
It would be useful for being able to easily navigate to failing tests if the tests don't panic when they should. Specifically, providing the file and line number of the failing test allows a user to use the mouse to navigate directly in one step from a test run in a vscode terminal window to the location of the failing test.
Given:
#[test]
#[should_panic]
fn dont_panic() {
// DON'T PANIC
}
This reports:
running 1 test
test dont_panic - should panic ... FAILED
successes:
successes:
failures:
---- dont_panic stdout ----
note: test did not panic as expected
failures:
dont_panic
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compare this with:
#[test]
fn do_panic() {
panic!("Panic!");
}
which gives:
---- do_panic stdout ----
thread 'do_panic' panicked at src/lib.rs:9:5:
Panic!
stack backtrace:
...
Which in a vscode terminal looks like:
Implementation Constraints:
Use filename:line:column format - don't use a custom formate like "file at line x". Noted specifically This has happened in some parts of the rust ecosystem in the past (in rustfmt IIRC), and it makes the automatic navigation not work right.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done