Skip to content

Commit 30f8621

Browse files
committed
Merge remote-tracking branch 'brson/shorttestnames' into HEAD
2 parents ac9481a + 3da7c8f commit 30f8621

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/compiletest/compiletest.rc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,17 @@ pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
254254
}
255255

256256
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
257+
258+
// Try to elide redundant long paths
259+
fn shorten(path: &Path) -> ~str {
260+
let filename = path.filename();
261+
let dir = path.pop().filename();
262+
fmt!("%s/%s", dir.get_or_default(~""), filename.get_or_default(~""))
263+
}
264+
257265
test::DynTestName(fmt!("[%s] %s",
258266
mode_str(config.mode),
259-
testfile.to_str()))
267+
shorten(testfile)))
260268
}
261269

262270
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {

0 commit comments

Comments
 (0)