t9400-git-cvsserver-server: Wrap setup into test case

It is preferable to have the test setup in a test case.  The
setup itself may fail and having it as a test case handles this
situation more gracefully.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Steffen Prohaska 2008-01-26 10:54:05 +01:00 committed by Junio C Hamano
parent ab8daa1836
commit 7549376587

View File

@ -33,13 +33,14 @@ CVS_SERVER=git-cvsserver
export CVSROOT CVS_SERVER export CVSROOT CVS_SERVER
rm -rf "$CVSWORK" "$SERVERDIR" rm -rf "$CVSWORK" "$SERVERDIR"
echo >empty && test_expect_success 'setup' '
echo >empty &&
git add empty && git add empty &&
git commit -q -m "First Commit" && git commit -q -m "First Commit" &&
git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 && git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" || GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
exit 1 '
# note that cvs doesn't accept absolute pathnames # note that cvs doesn't accept absolute pathnames
# as argument to co -d # as argument to co -d