Merge branch 'jc/skip-test-in-the-middle'
authorJunio C Hamano <gitster@pobox.com>
Tue, 30 May 2017 02:16:44 +0000 (11:16 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 May 2017 02:16:44 +0000 (11:16 +0900)
A recent update to t5545-push-options.sh started skipping all the
tests in the script when a web server testing is disabled or
unavailable, not just the ones that require a web server. Non HTTP
tests have been salvaged to always run in this script.

* jc/skip-test-in-the-middle:
t5545: enhance test coverage when no http server is installed
test: allow skipping the remainder

1  2 
t/test-lib.sh
diff --cc t/test-lib.sh
index 26b3edfb2e4e725f589fc99986587aa3ecb48b75,30eb7437198dddbb2d251e9ec91590754b1eddcf..ec2571f0185b7c6aad15e3b01e67f6b79b643928
@@@ -758,18 -751,25 +751,30 @@@ test_done () 
                        then
                                say_color pass "# passed all $msg"
                        fi
-                       say "1..$test_count$skip_all"
+                       # Maybe print SKIP message
+                       test -z "$skip_all" || skip_all="# SKIP $skip_all"
+                       case "$test_count" in
+                       0)
+                               say "1..$test_count${skip_all:+ $skip_all}"
+                               ;;
+                       *)
+                               test -z "$skip_all" ||
+                               say_color warn "$skip_all"
+                               say "1..$test_count"
+                               ;;
+                       esac
                fi
  
 -              test -d "$remove_trash" &&
 -              cd "$(dirname "$remove_trash")" &&
 -              rm -rf "$(basename "$remove_trash")"
 +              if test -z "$debug"
 +              then
 +                      test -d "$TRASH_DIRECTORY" ||
 +                      error "Tests passed but trash directory already removed before test cleanup; aborting"
  
 +                      cd "$TRASH_DIRECTORY/.." &&
 +                      rm -fr "$TRASH_DIRECTORY" ||
 +                      error "Tests passed but test cleanup failed; aborting"
 +              fi
                test_at_end_hook_
  
                exit 0 ;;