Merge branch 'vr/use-our-perl-in-tests'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Jul 2012 16:01:52 +0000 (09:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jul 2012 16:01:52 +0000 (09:01 -0700)
Some implementations of Perl terminates "lines" with CRLF even when
the script is operating on just a sequence of bytes. Make sure to
use "$PERL_PATH", the version of Perl the user told Git to use, in
our tests to avoid unnecessary breakages in tests.

* vr/use-our-perl-in-tests:
t/README: add a bit more Don'ts
tests: enclose $PERL_PATH in double quotes
t/test-lib.sh: export PERL_PATH for use in scripts
t: Replace 'perl' by $PERL_PATH

1  2 
t/t5300-pack-object.sh
t/t9300-fast-import.sh
diff --combined t/t5300-pack-object.sh
index 300ed910a5baa6ac0657c59ecc02a2516d99c6cd,4fd69a19ebab07cc0ca784b63a7f02ddd613f306..2e52f8b83894faa0aeb324d8c43193b2cc9ea0cc
@@@ -13,9 -13,9 +13,9 @@@ TRASH=`pwd
  test_expect_success \
      'setup' \
      'rm -f .git/index* &&
-      perl -e "print \"a\" x 4096;" > a &&
-      perl -e "print \"b\" x 4096;" > b &&
-      perl -e "print \"c\" x 4096;" > c &&
+      "$PERL_PATH" -e "print \"a\" x 4096;" > a &&
+      "$PERL_PATH" -e "print \"b\" x 4096;" > b &&
+      "$PERL_PATH" -e "print \"c\" x 4096;" > c &&
       test-genrandom "seed a" 2097152 > a_big &&
       test-genrandom "seed b" 2097152 > b_big &&
       git update-index --add a a_big b b_big c &&
@@@ -129,7 -129,7 +129,7 @@@ test_expect_success 
  cd "$TRASH"
  
  test_expect_success 'compare delta flavors' '
-       perl -e '\''
+       "$PERL_PATH" -e '\''
                defined($_ = -s $_) or die for @ARGV;
                exit 1 if $ARGV[0] <= $ARGV[1];
        '\'' test-2-$packname_2.pack test-3-$packname_3.pack
@@@ -418,9 -418,4 +418,9 @@@ test_expect_success 
      'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&
       grep "SHA1 COLLISION FOUND" msg'
  
 +test_expect_success \
 +    'make sure index-pack detects the SHA1 collision (large blobs)' \
 +    'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg &&
 +     grep "SHA1 COLLISION FOUND" msg'
 +
  test_done
diff --combined t/t9300-fast-import.sh
index c17f52e586747198a74323b578a654edec436f57,11f977bec2e3b913a4beed59643be01ccad86435..2fcf2694696fedb5e7e3d57c869f7dbbbf23dbec
@@@ -12,7 -12,7 +12,7 @@@ test_description='test git fast-import 
  # This could be written as "head -c $1", but IRIX "head" does not
  # support the -c option.
  head_c () {
-       perl -e '
+       "$PERL_PATH" -e '
                my $len = $ARGV[1];
                while ($len > 0) {
                        my $s;
@@@ -2117,7 -2117,7 +2117,7 @@@ test_expect_success 
      grep :1 git.marks'
  
  test_expect_success \
 -    'R: export-marks options can be overriden by commandline options' \
 +    'R: export-marks options can be overridden by commandline options' \
      'cat input | git fast-import --export-marks=other.marks &&
      grep :1 other.marks'