t9200: handle missing CVS with skip_all
PATCH 1/1 t9200: handle missing CVS with skip_all
CVS initialization runs outside a test_expect_success and when it fails, the error report isn't good.
Wrap CVS initialization in a skip_all check so when CVS initialization fails, the error report becomes clearer.
Move the Git repo initialization into its own test_expect_success instead of being in the same CVS check.
Signed-off-by Pablo Sabater <[email protected]>
--- t/t9200-git-cvsexportcommit.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
t/t9200-git-cvsexportcommit.sh +11 -7
@@ -30,13 +30,17 @@ export CVSROOT CVSWORK GIT_DIR rm -rf "$CVSROOT" "$CVSWORK" -cvs init && -test -d "$CVSROOT" && -cvs -Q co -d "$CVSWORK" . && -echo >empty && -git add empty && -git commit -q -a -m "Initial" 2>/dev/null || -exit 1 +if ! cvs init || ! test -d "$CVSROOT" || ! cvs -Q co -d "$CVSWORK" . +then + skip_all="cvs repository set-up fails" + test_done +fi + +test_expect_success 'git setup' ' + echo >empty && + git add empty && + git commit -q -a -m Initial +' check_entries () { # $1 == directory, $2 == expected
Signature · 1 line
2.43.0
Quoted 6 lines · Pablo Sabater
CVS initialization runs outside a
test_expect_successand when it fails, the error report isn't good.Wrap CVS initialization in a
skip_allcheck so when CVS initialization fails, the error report becomes clearer.
Quoted 7 lines
Move the Git repo initialization into its own
test_expect_successinstead of being in the same CVS check.Signed-off-by Pablo Sabater <[email protected]>--- t/t9200-git-cvsexportcommit.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
Makes sense. Will queue. Thanks.
Quoted 29 lines
t/t9200-git-cvsexportcommit.sh +11
-7@@ -30,13 +30,17 @@ export CVSROOT CVSWORK GIT_DIR rm -rf "$CVSROOT" "$CVSWORK" -cvs init && -test -d "$CVSROOT" && -cvs -Q co -d "$CVSWORK" . && -echo >empty && -git add empty && -git commit -q -a -m "Initial" 2>/dev/null || -exit 1 +if ! cvs init || ! test -d "$CVSROOT" || ! cvs -Q co -d "$CVSWORK" . +then + skip_all="cvs repository set-up fails" + test_done +fi + +test_expect_success 'git setup' ' + echo >empty && + git add empty && + git commit -q -a -m Initial +' check_entries () { # $1 == directory, $2 == expected