X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/b44b02a98253e78334f7fd13d9c4e1eb59562392..837d464af77d76a2661d92e05167657cbf430d80:/tests/setup.sh diff --git a/tests/setup.sh b/tests/setup.sh index 5f20286..1457dd5 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -31,6 +31,13 @@ mkrepo() { git add file-$n git commit -m "commit $n" done + if test "$3" = "testplus" + then + echo "hello" >a+b + git add a+b + git commit -m "add a+b" + git branch "1+2" + fi cd $dir } @@ -40,11 +47,12 @@ setup_repos() mkdir -p trash/cache mkrepo trash/repos/foo 5 >/dev/null mkrepo trash/repos/bar 50 >/dev/null + mkrepo trash/repos/foo+bar 10 testplus >/dev/null cat >trash/cgitrc </dev/null test_count=0 test_failed=0 + echo "[$0]" "$@" >test-output.log echo "$@" "($0)" } @@ -77,7 +91,8 @@ tests_done() printf "\n" if test $test_failed -gt 0 then - printf "[%s of %s tests failed]\n" $test_failed $test_count + printf "test: *** %s failure(s), logfile=%s\n" \ + $test_failed "$(pwd)/test-output.log" false fi } @@ -87,8 +102,11 @@ run_test() desc=$1 script=$2 ((test_count++)) - eval "$2" >test-output.log + printf "\ntest %d: name='%s'\n" $test_count "$desc" >>test-output.log + printf "test %d: eval='%s'\n" $test_count "$2" >>test-output.log + eval "$2" >>test-output.log 2>>test-output.log res=$? + printf "test %d: exitcode=%d\n" $test_count $res >>test-output.log if test $res = 0 then printf " %2d) %-60s [ok]\n" $test_count "$desc" @@ -107,4 +125,3 @@ cgit_url() { CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="url=$1" "$PWD/../cgit" } -