summaryrefslogtreecommitdiffabout
path: root/tests
authorLars Hjemli <hjemli@gmail.com>2008-12-06 11:03:54 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-12-06 11:03:54 (UTC)
commitb6faa78091a1340b73e291f1f87604f246d3f391 (patch) (side-by-side diff)
treeb6a7d2ee0fd9bc8ab2c6346dd30a49244f401e1c /tests
parent2755af6e29801ea10b5d7be6a0a5635ba3bc9660 (diff)
downloadcgit-b6faa78091a1340b73e291f1f87604f246d3f391.zip
cgit-b6faa78091a1340b73e291f1f87604f246d3f391.tar.gz
cgit-b6faa78091a1340b73e291f1f87604f246d3f391.tar.bz2
tests/setup.sh: allow testsuite to fail properly with POSIX standard shells
The "((expr))" construct is not implemented by e.g. dash, so this commit replaces the construct with a more portable one. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'tests') (more/less context) (ignore whitespace changes)
-rwxr-xr-xtests/setup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/setup.sh b/tests/setup.sh
index 95acb54..30f90d5 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -104,25 +104,25 @@ run_test()
desc=$1
script=$2
test_count=$(expr $test_count + 1)
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"
else
- ((test_failed++))
+ test_failed=$(expr $test_failed + 1)
printf " %2d) %-60s [failed]\n" $test_count "$desc"
fi
}
cgit_query()
{
CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="$1" "$PWD/../cgit"
}
cgit_url()
{
CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="url=$1" "$PWD/../cgit"