mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
compiletest: Shorten test names
This commit is contained in:
parent
fc83d82fec
commit
3da7c8f7e1
@ -253,9 +253,17 @@ pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
|
||||
}
|
||||
|
||||
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
|
||||
|
||||
// Try to elide redundant long paths
|
||||
fn shorten(path: &Path) -> ~str {
|
||||
let filename = path.filename();
|
||||
let dir = path.pop().filename();
|
||||
fmt!("%s/%s", dir.get_or_default(~""), filename.get_or_default(~""))
|
||||
}
|
||||
|
||||
test::DynTestName(fmt!("[%s] %s",
|
||||
mode_str(config.mode),
|
||||
testfile.to_str()))
|
||||
shorten(testfile)))
|
||||
}
|
||||
|
||||
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
|
||||
|
Loading…
Reference in New Issue
Block a user