From 3da7c8f7e11952df0737a1578b87b626a5f4b05a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 23 Jun 2013 01:27:34 -0700 Subject: [PATCH] compiletest: Shorten test names --- src/compiletest/compiletest.rc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index e832534b227..7594a3739df 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -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 {