X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/b8a7eb12d459c48943e31762b24b169af8c427a1..561959cffa3de67986d193469b77c8db0d307400:/tests/setup.sh diff --git a/tests/setup.sh b/tests/setup.sh index 95acb54..651f940 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -15,15 +15,16 @@ # run_test 'repo index' 'cgit_url "/" | tidy -e' # run_test 'repo summary' 'cgit_url "/foo" | tidy -e' +unset CDPATH mkrepo() { name=$1 count=$2 dir=$PWD - test -d $name && return - printf "Creating testrepo %s\n" $name - mkdir -p $name - cd $name + test -d "$name" && return + printf "Creating testrepo %s\n" "$name" + mkdir -p "$name" + cd "$name" git init n=1 while test $n -le $count @@ -40,7 +41,7 @@ mkrepo() { git commit -m "add a+b" git branch "1+2" fi - cd $dir + cd "$dir" } setup_repos() @@ -50,6 +51,7 @@ setup_repos() mkrepo trash/repos/foo 5 >/dev/null mkrepo trash/repos/bar 50 >/dev/null mkrepo trash/repos/foo+bar 10 testplus >/dev/null + mkrepo "trash/repos/with space" 2 >/dev/null cat >trash/cgitrc <>test-output.log 2>>test-output.log res=$? printf "test %d: exitcode=%d\n" $test_count $res >>test-output.log - if test $res = 0 + if test $res = 0 -a $bug = 0 then printf " %2d) %-60s [ok]\n" $test_count "$desc" + elif test $res = 0 -a $bug = 1 + then + printf " %2d) %-60s [BUG FIXED]\n" $test_count "$desc" + elif test $bug = 1 + then + printf " %2d) %-60s [KNOWN BUG]\n" $test_count "$desc" else - ((test_failed++)) + test_failed=$(expr $test_failed + 1) printf " %2d) %-60s [failed]\n" $test_count "$desc" fi }