about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-06-23 01:27:34 -0700
committerBrian Anderson <banderson@mozilla.com>2013-06-23 12:50:11 -0700
commit3da7c8f7e11952df0737a1578b87b626a5f4b05a (patch)
treec66779add1172f24b2ccedc380f96eae3ee2cfa6
parentfc83d82fec5bc338ffa4aaf00ca2aef6bfd473a4 (diff)
downloadrust-3da7c8f7e11952df0737a1578b87b626a5f4b05a.tar.gz
rust-3da7c8f7e11952df0737a1578b87b626a5f4b05a.zip
compiletest: Shorten test names
-rw-r--r--src/compiletest/compiletest.rc10
1 files changed, 9 insertions, 1 deletions
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 {