-rwxr-xr-x | tests/setup.sh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/setup.sh b/tests/setup.sh index 51d5a75..66bf406 100755 --- a/tests/setup.sh +++ b/tests/setup.sh | |||
@@ -55,5 +55,7 @@ summary-tags=5 | |||
55 | repo.url=foo | 55 | repo.url=foo |
56 | repo.path=$PWD/trash/repos/foo/.git | 56 | repo.path=$PWD/trash/repos/foo/.git |
57 | repo.desc=the foo repo | 57 | # Do not specify a description for this repo, as it then will be assigned |
58 | # the constant value "[no description]" (which actually used to cause a | ||
59 | # segfault). | ||
58 | 60 | ||
59 | repo.url=bar | 61 | repo.url=bar |
@@ -66,6 +68,8 @@ prepare_tests() | |||
66 | { | 68 | { |
67 | setup_repos | 69 | setup_repos |
70 | rm -f test-output.log 2>/dev/null | ||
68 | test_count=0 | 71 | test_count=0 |
69 | test_failed=0 | 72 | test_failed=0 |
73 | echo "[$0]" "$@" >test-output.log | ||
70 | echo "$@" "($0)" | 74 | echo "$@" "($0)" |
71 | } | 75 | } |
@@ -76,5 +80,6 @@ tests_done() | |||
76 | if test $test_failed -gt 0 | 80 | if test $test_failed -gt 0 |
77 | then | 81 | then |
78 | printf "[%s of %s tests failed]\n" $test_failed $test_count | 82 | printf "test: *** %s failure(s), logfile=%s\n" \ |
83 | $test_failed "$(pwd)/test-output.log" | ||
79 | false | 84 | false |
80 | fi | 85 | fi |
@@ -86,12 +91,15 @@ run_test() | |||
86 | script=$2 | 91 | script=$2 |
87 | ((test_count++)) | 92 | ((test_count++)) |
88 | eval "$2" >test-output.log | 93 | printf "\ntest %d: name='%s'\n" $test_count "$desc" >>test-output.log |
94 | printf "test %d: eval='%s'\n" $test_count "$2" >>test-output.log | ||
95 | eval "$2" >>test-output.log 2>>test-output.log | ||
89 | res=$? | 96 | res=$? |
97 | printf "test %d: exitcode=%d\n" $test_count $res >>test-output.log | ||
90 | if test $res = 0 | 98 | if test $res = 0 |
91 | then | 99 | then |
92 | printf " %s: ok - %s\n" $test_count "$desc" | 100 | printf " %2d) %-60s [ok]\n" $test_count "$desc" |
93 | else | 101 | else |
94 | ((test_failed++)) | 102 | ((test_failed++)) |
95 | printf " %s: fail - %s\n" $test_count "$desc" | 103 | printf " %2d) %-60s [failed]\n" $test_count "$desc" |
96 | fi | 104 | fi |
97 | } | 105 | } |