git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t9400-git-cvsserver-server: Wrap setup into test case

From
Steffen Prohaska <prohaska@zib.de>
Date
Jan 26, 2008, 09:54 UTC
Message-ID
<12013412461111-git-send-email-prohaska@zib.de>

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

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 t/t9400-git-cvsserver-server.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 641303e..1f2749e 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -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
-- 
1.5.4.rc4.42.gacc73
Next: Steffen Prohaska
Message 1 of 5 in “t9400-git-cvsserver-server: Wrap setup into test case”
  1. 1/2 t9400-git-cvsserver-server: Wrap setup into test caseSteffen Prohaska, Jan 26, 2008
  2. 2/2 cvsserver: Fix for histories with multiple rootsSteffen Prohaska, Jan 26, 2008
  3. Junio C HamanoJan 27, 2008
  4. cvsserver: Fix for histories with multiple rootsSteffen Prohaska, Jan 27, 2008
  5. Steffen ProhaskaJan 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.