[PATCH] t9143: do not fail if Compress::Zlib is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"git svn gc" will not compress unhandled.log files if
Compress::Zlib is missing.  However, leftover index files should
always be removed, so add a test for this behavior as well.

Signed-off-by: Eric Wong <normalperson@xxxxxxxx>
---
  Junio C Hamano <gitster@xxxxxxxxx> wrote:
  > Eric Wong <normalperson@xxxxxxxx> writes:
  > 
  > >   # I thought I had pushed this out earlier:
  > >   Robert Allan Zeh (1):
  > >         git svn: add gc command
  > 
  > Note that with this commit, the test fails needlessly if Compress::Zlib is
  > not found, even though otherwise "svn gc" succeeds (for some definition of
  > "success")..

  Oops, this test completely slipped my mind even though I caught the
  issue in the original code.  Pushed out to git://git.bogomips.org/git-svn

 t/t9143-git-svn-gc.sh |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh
index aaa3af0..f2ba2d1 100755
--- a/t/t9143-git-svn-gc.sh
+++ b/t/t9143-git-svn-gc.sh
@@ -31,11 +31,20 @@ test_expect_success 'make backup copy of unhandled.log' '
 	 cp .git/svn/git-svn/unhandled.log tmp
 	'
 
+test_expect_success 'create leftover index' '> .git/svn/git-svn/index'
+
 test_expect_success 'git svn gc runs' 'git svn gc'
 
-test_expect_success 'git svn gc produces a valid gzip file' '
-	 gunzip .git/svn/git-svn/unhandled.log.gz
-	'
+test_expect_success 'git svn index removed' '! test -f .git/svn/git-svn/index'
+
+if perl -MCompress::Zlib -e 0 2>/dev/null
+then
+	test_expect_success 'git svn gc produces a valid gzip file' '
+		 gunzip .git/svn/git-svn/unhandled.log.gz
+		'
+else
+	say "Perl Compress::Zlib unavailable, skipping gunzip test"
+fi
 
 test_expect_success 'git svn gc does not change unhandled.log files' '
 	 test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log
-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]