diff options
author | Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> | 2012-10-12 16:43:28 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-10-18 08:44:37 -0300 |
commit | b52ee879d869304c981be713566b40aa3f7a44db (patch) | |
tree | 658abf7304e4c142b3ba151335a094971d646098 /test/test-lib.sh | |
parent | 345faab1f5c73f5412677d4a0aaa383a8462b2e5 (diff) |
test: handle filenames that have directories in them
Since $TEST_DIRECTORY is an absolute path, any filenames generated
with it will be complete paths. Only use the basename to generate
suffixes for filenames.
Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
Diffstat (limited to 'test/test-lib.sh')
-rw-r--r-- | test/test-lib.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh index 7448b454..8de5e32f 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -498,16 +498,18 @@ test_expect_equal_file () error "bug in the test script: not 2 or 3 parameters to test_expect_equal" file1="$1" + basename1=`basename "$file1"` file2="$2" + basename2=`basename "$file2"` if ! test_skip "$test_subtest_name" then if diff -q "$file1" "$file2" >/dev/null ; then test_ok_ "$test_subtest_name" else testname=$this_test.$test_count - cp "$file1" "$testname.$file1" - cp "$file2" "$testname.$file2" - test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")" + cp "$file1" "$testname.$basename1" + cp "$file2" "$testname.$basename2" + test_failure_ "$test_subtest_name" "$(diff -u "$testname.$basename1" "$testname.$basename2")" fi fi } |