components/git/patches/test.patch
branchs11u3-sru
changeset 5720 519e1bb835ee
equal deleted inserted replaced
5713:b6d980e5e998 5720:519e1bb835ee
       
     1 A couple of tests need patching:
       
     2 
       
     3   - There's a garbled sed command in the clone tests, which works for GNU
       
     4     sed, but not for Solaris.
       
     5 
       
     6   - Because we're doing the build in a symlink farm, one of the diff tests
       
     7     thinks that we're changing the type of the files from symlink to file,
       
     8     so the diffs come out wrong.  Rather than cleverly mucking around with
       
     9     the working directory vs the repo directory, we just cat the files as
       
    10     real files into place.
       
    11 
       
    12 The first patch is probably fine for upstream; the latter perhaps less so.
       
    13 
       
    14 --- git-2.4.5/t/t5601-clone.sh	Thu Jun 25 12:15:40 2015
       
    15 +++ git-2.4.5/t/t5601-clone.sh	Thu Jul  2 12:35:08 2015
       
    16 @@ -445,7 +445,7 @@
       
    17  #IPv6
       
    18  for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
       
    19  do
       
    20 -	ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
       
    21 +	ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]")
       
    22  	test_expect_success "clone ssh://$tuah/home/user/repo" "
       
    23  	  test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
       
    24  	"
       
    25 --- git-2.4.5/t/t4018-diff-funcname.sh	Thu Jun 25 12:15:40 2015
       
    26 +++ git-2.4.5/t/t4018-diff-funcname.sh	Thu Jul  2 14:11:09 2015
       
    27 @@ -79,8 +79,11 @@
       
    28  
       
    29  	# add all test files to the index
       
    30  	(
       
    31 -		cd "$TEST_DIRECTORY"/t4018 &&
       
    32 -		git --git-dir="$TRASH_DIRECTORY/.git" add .
       
    33 +		( cd "$TEST_DIRECTORY"/t4018 && printf "%s\n" * ) | while read f
       
    34 +		do
       
    35 +			cat "$TEST_DIRECTORY"/t4018/$f > $f
       
    36 +			git add -v $f
       
    37 +		done
       
    38  	) &&
       
    39  
       
    40  	# place modified files in the worktree
       
    41 
       
    42 
       
    43 This simply adds a couple of targets to the test Makefile which allow us to
       
    44 run the tests in parallel cleanly.  This way the results don't get cleaned
       
    45 up automatically after running the tests, and we can emit those results to
       
    46 the master file.  This might be interesting to upstream, but is really
       
    47 specific to running the tests in an external framework.
       
    48 
       
    49 --- git-2.7.4/t/Makefile	Thu Mar 17 13:47:59 2016
       
    50 +++ git-2.7.4/t/Makefile	Tue Mar 22 14:28:40 2016
       
    51 @@ -36,6 +36,9 @@
       
    52  test: pre-clean $(TEST_LINT)
       
    53  	$(MAKE) aggregate-results-and-cleanup
       
    54  
       
    55 +test-noclean: pre-clean $(TEST_LINT)
       
    56 +	$(MAKE) T
       
    57 +
       
    58  prove: pre-clean $(TEST_LINT)
       
    59  	@echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
       
    60  	$(MAKE) clean-except-prove-cache
       
    61 @@ -68,6 +71,8 @@
       
    62  test-lint-shell-syntax:
       
    63  	@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
       
    64  
       
    65 +T: $(T)
       
    66 +
       
    67  aggregate-results-and-cleanup: $(T)
       
    68  	$(MAKE) aggregate-results
       
    69  	$(MAKE) clean
       
    70 
       
    71 
       
    72 This is a Solaris-specific patch that turns on GnuPG in the tests, which it
       
    73 wouldn't otherwise because we don't deliver GnuPG in its usual path.
       
    74 
       
    75 --- git-2.7.4/t/lib-gpg.sh	Thu Mar 17 13:47:59 2016
       
    76 +++ git-2.7.4/t/lib-gpg.sh	Tue Mar 22 14:40:59 2016
       
    77 @@ -1,5 +1,9 @@
       
    78  #!/bin/sh
       
    79  
       
    80 +gpg() {
       
    81 +	gpg2 "$@"
       
    82 +}
       
    83 +
       
    84  gpg_version=$(gpg --version 2>&1)
       
    85  if test $? = 127; then
       
    86  	say "You do not seem to have gpg installed"
       
    87 
       
    88 
       
    89 This allows Apache 2.4 to load on Solaris.
       
    90 
       
    91 --- git-2.7.4/t/lib-httpd/apache.conf	Thu Mar 17 13:47:59 2016
       
    92 +++ git-2.7.4/t/lib-httpd/apache.conf	Tue Mar 22 15:15:56 2016
       
    93 @@ -64,6 +64,9 @@
       
    94  <IfModule !mod_mpm_prefork.c>
       
    95  	LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
       
    96  </IfModule>
       
    97 +<IfModule !mod_unixd.c>
       
    98 +	LoadModule unixd_module modules/mod_unixd.so
       
    99 +</IfModule>
       
   100  </IfVersion>
       
   101  
       
   102  PassEnv GIT_VALGRIND