diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-23 01:27:34 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-23 12:50:11 -0700 |
| commit | 3da7c8f7e11952df0737a1578b87b626a5f4b05a (patch) | |
| tree | c66779add1172f24b2ccedc380f96eae3ee2cfa6 | |
| parent | fc83d82fec5bc338ffa4aaf00ca2aef6bfd473a4 (diff) | |
| download | rust-3da7c8f7e11952df0737a1578b87b626a5f4b05a.tar.gz rust-3da7c8f7e11952df0737a1578b87b626a5f4b05a.zip | |
compiletest: Shorten test names
| -rw-r--r-- | src/compiletest/compiletest.rc | 10 |
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 { |
