Merge branch 'tr/valgrind'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2013 16:34:44 +0000 (09:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2013 16:34:44 +0000 (09:34 -0700)
Let us use not just memgrind but other *grind debuggers.

* tr/valgrind:
tests: notice valgrind error in test_must_fail
tests --valgrind: provide a mode without --track-origins
tests: parameterize --valgrind option
t/README: --valgrind already implies -v

1  2 
t/test-lib-functions.sh
diff --combined t/test-lib-functions.sh
index 42c2258b4fdf37b9d2e440f0918f8e4e4f7608f0,6766553c31ff88e391e179c664756f908e74f4e4..52510094add59b508e1581ffebfa555e7249561c
@@@ -91,10 -91,6 +91,10 @@@ q_to_tab () 
        tr Q '\011'
  }
  
 +qz_to_tab_space () {
 +      tr QZ '\011\040'
 +}
 +
  append_cr () {
        sed -e 's/$/Q/' | tr Q '\015'
  }
@@@ -139,12 -135,12 +139,12 @@@ test_pause () 
        fi
  }
  
 -# Call test_commit with the arguments "<message> [<file> [<contents>]]"
 +# Call test_commit with the arguments "<message> [<file> [<contents> [<tag>]]]"
  #
  # This will commit a file with the given contents and the given commit
 -# message.  It will also add a tag with <message> as name.
 +# message, and tag the resulting commit with the given tag name.
  #
 -# Both <file> and <contents> default to <message>.
 +# <file>, <contents>, and <tag> all default to <message>.
  
  test_commit () {
        notick= &&
                test_tick
        fi &&
        git commit $signoff -m "$1" &&
 -      git tag "$1"
 +      git tag "${4:-$1}"
  }
  
  # Call test_merge with the arguments "<message> <commit>", where <commit>
@@@ -540,6 -536,9 +540,9 @@@ test_must_fail () 
        elif test $exit_code = 127; then
                echo >&2 "test_must_fail: command not found: $*"
                return 1
+       elif test $exit_code = 126; then
+               echo >&2 "test_must_fail: valgrind error: $*"
+               return 1
        fi
        return 0
  }