From: Junio C Hamano Date: Mon, 1 Oct 2012 19:59:06 +0000 (-0700) Subject: Merge branch 'ep/malloc-check-perturb' X-Git-Tag: v1.8.0-rc0~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/70dac5f44d60a3f2de68c17157c21e663fc75616?hp=-c Merge branch 'ep/malloc-check-perturb' Fixes a brown-paper bag bug. * ep/malloc-check-perturb: MALLOC_CHECK: enable it, unless disabled explicitly --- 70dac5f44d60a3f2de68c17157c21e663fc75616 diff --combined t/test-lib.sh index bfc223815c,9ecbc409a2..514282cbdf --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -15,6 -15,22 +15,6 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/ . -# if --tee was passed, write the output not only to the terminal, but -# additionally to the file test-results/$BASENAME.out, too. -case "$GIT_TEST_TEE_STARTED, $* " in -done,*) - # do not redirect again - ;; -*' --tee '*|*' --va'*) - mkdir -p test-results - BASE=test-results/$(basename "$0" .sh) - (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1; - echo $? > $BASE.exit) | tee $BASE.out - test "$(cat $BASE.exit)" = 0 - exit - ;; -esac - # Keep the original TERM for say_color ORIGINAL_TERM=$TERM @@@ -35,34 -51,9 +35,34 @@@ the fi GIT_BUILD_DIR="$TEST_DIRECTORY"/.. +################################################################ +# It appears that people try to run tests without building... +"$GIT_BUILD_DIR/git" >/dev/null +if test $? != 1 +then + echo >&2 'error: you do not seem to have built git yet.' + exit 1 +fi + . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS export PERL_PATH SHELL_PATH +# if --tee was passed, write the output not only to the terminal, but +# additionally to the file test-results/$BASENAME.out, too. +case "$GIT_TEST_TEE_STARTED, $* " in +done,*) + # do not redirect again + ;; +*' --tee '*|*' --va'*) + mkdir -p test-results + BASE=test-results/$(basename "$0" .sh) + (GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1; + echo $? > $BASE.exit) | tee $BASE.out + test "$(cat $BASE.exit)" = 0 + exit + ;; +esac + # For repeatability, reset the environment to known value. LANG=C LC_ALL=C @@@ -105,7 -96,7 +105,7 @@@ export EDITO # Add libc MALLOC and MALLOC_PERTURB test # only if we are not executing the test with valgrind if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null || - test -n "TEST_NO_MALLOC_" + test -n "$TEST_NO_MALLOC_CHECK" then setup_malloc_check () { : nothing