test-lib: avoid full path to store test results
No reason to use the full path in case this is used externally. Otherwise we might get errors such as: ./test-lib.sh: line 394: /home/bob/dev/git/t/test-results//home/bob/dev/git/contrib/remote-hg/test-2894.counts: No such file or directory Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
Felipe Contreras committed
Nov 4, 2012 at 03:13 UTC
dd78478fe115072df2cd0756eb1c59dd70d554da
1 file changed
+2
-1
t/test-lib.sh
+2
-1
@@ -389,7 +389,8 @@ test_done () {
389
then
390
test_results_dir="$TEST_OUTPUT_DIRECTORY/test-results"
391
mkdir -p "$test_results_dir"
392
- test_results_path="$test_results_dir/${0%.sh}-$$.counts"
392
+ base=${0##*/}
393
+ test_results_path="$test_results_dir/${base%.sh}-$$.counts"
394
395
cat >>"$test_results_path" <<-EOF
396
total $test_count