SVN_TREE=$GIT_SVN_DIR/svn-tree
test_set_port SVNSERVE_PORT
-svn >/dev/null 2>&1
-if test $? -ne 1
+if ! svn help >/dev/null 2>&1
then
skip_all='skipping git svn tests, svn not found'
test_done
svnconf=$PWD/svnconf
export svnconf
+x=0
perl -w -e "
use SVN::Core;
use SVN::Repos;
\$SVN::Core::VERSION gt '1.1.0' or exit(42);
system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
-" >&3 2>&4
-x=$?
+" >&3 2>&4 || x=$?
if test $x -ne 0
then
if test $x -eq 42; then
test_atexit stop_httpd
- "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
+ if ! "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
-c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
>&3 2>&4
- if test $? -ne 0
then
cat "$HTTPD_ROOT_PATH"/error.log >&4 2>/dev/null
test_skip_or_die GIT_TEST_HTTPD "web server setup failed"
8859)
grep "^encoding ISO8859-1" ;;
*)
- grep "^encoding ISO8859-1"; test "$?" != 0 ;;
+ ret=0; grep "^encoding ISO8859-1" || ret=$?
+ test "$ret" != 0 ;;
esac || return 1
j=$i
i=$(($i+1))
# would generate the whole 64GB).
test_expect_success LONG_IS_64BIT 'generate tar with huge size' '
{
- git archive HEAD
- echo $? >exit-code
+ { ret=0 && git archive HEAD || ret=$?; } &&
+ echo "$ret" >exit-code
} | test_copy_bytes 4096 >huge.tar &&
echo 141 >expect &&
test_cmp expect exit-code
(
cd repo &&
GIT_ALLOW_PROTOCOL=file git submodule add "$(pwd)"/../submodule &&
- { git submodule status --recursive 2>err; echo $?>status; } |
+ { { ret=0 && git submodule status --recursive 2>err || ret=$?; } && echo $ret >status; } |
grep -q recursive-submodule-path-1 &&
test_must_be_empty err &&
test_match_signal 13 "$(cat status)"
test_done
fi
-cvs >/dev/null 2>&1
-if test $? -ne 1
+if ! cvs version >/dev/null 2>&1
then
skip_all='skipping git cvsexportcommit tests, cvs not found'
test_done
skip_all='skipping git cvsserver tests, perl not available'
test_done
fi
-cvs >/dev/null 2>&1
-if test $? -ne 1
+
+if ! cvs version >/dev/null 2>&1
then
skip_all='skipping git-cvsserver tests, cvs not found'
test_done
fi
+
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
test_done
return $stat
}
-cvs >/dev/null 2>&1
-if test $? -ne 1
+if ! cvs version >/dev/null 2>&1
then
skip_all='skipping git-cvsserver tests, cvs not found'
test_done
fi
+
if ! test_have_prereq PERL
then
skip_all='skipping git-cvsserver tests, perl not available'
#########
-cvs >/dev/null 2>&1
-if test $? -ne 1
+if ! cvs version >/dev/null 2>&1
then
skip_all='skipping git-cvsserver tests, cvs not found'
test_done
fi
+
if ! test_have_prereq PERL
then
skip_all='skipping git-cvsserver tests, perl not available'
test_expect_code () {
want_code=$1
shift
- "$@" 2>&7
- exit_code=$?
+ exit_code=0; "$@" 2>&7 || exit_code=$?
if test $exit_code = $want_code
then
return 0
################################################################
# It appears that people try to run tests without building...
GIT_BINARY="${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X"
-"$GIT_BINARY" >/dev/null
-if test $? != 1
+
+if ! "$GIT_BINARY" version >/dev/null
then
if test -n "$GIT_TEST_INSTALLED"
then
# from any previous runs.
>"$GIT_TEST_TEE_OUTPUT_FILE"
- (GIT_TEST_TEE_STARTED=done ${TEST_SHELL_PATH} "$0" "$@" 2>&1;
- echo $? >"$TEST_RESULTS_BASE.exit") | tee -a "$GIT_TEST_TEE_OUTPUT_FILE"
+ (
+ ret=0 && GIT_TEST_TEE_STARTED=done ${TEST_SHELL_PATH} "$0" "$@" 2>&1 || ret=$?
+ echo "$ret" >"$TEST_RESULTS_BASE.exit"
+ ) | tee -a "$GIT_TEST_TEE_OUTPUT_FILE"
test "$(cat "$TEST_RESULTS_BASE.exit")" = 0
exit
fi