Skip to content

Commit

Permalink
t9400-git-cvsserver-server: Wrap setup into test case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steffen Prohaska authored and Junio C Hamano committed Jan 27, 2008
1 parent ab8daa1 commit 7549376
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions t/t9400-git-cvsserver-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ CVS_SERVER=git-cvsserver
export CVSROOT CVS_SERVER

rm -rf "$CVSWORK" "$SERVERDIR"
echo >empty &&
test_expect_success 'setup' '
echo >empty &&
git add empty &&
git commit -q -m "First Commit" &&
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 gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
exit 1
GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
'

# note that cvs doesn't accept absolute pathnames
# as argument to co -d
Expand Down

0 comments on commit 7549376

Please sign in to comment.