r4953: - enable easy valgrind use in all our test scripts
authorAndrew Tridgell <tridge@samba.org>
Mon, 24 Jan 2005 01:15:30 +0000 (01:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:09 +0000 (13:09 -0500)
- when valgrind isn't set, then setup MALLOC_CHECK_ to abort on error
(This used to be commit 21e629e80e5b320616135d3f3641801dc29594e6)

source4/script/tests/test_posix.sh
source4/script/tests/test_rpc.sh
source4/script/tests/test_w2k3.sh

index da7fceee439acb1402c5b7084b2834bb5dfaa301..57dae705cdf22c412390e48b8e7233819375f1cb 100755 (executable)
@@ -10,6 +10,10 @@ EOF
 exit 1;
 fi
 
+if [ -z "$VALGRIND" ]; then
+    export MALLOC_CHECK_=2
+fi
+
 unc="$1"
 username="$2"
 password="$3"
index 9e11a3d69a5daf611d29799f01ea66edc8346e0a..83f7929614382ff3d83b0583bb6d2fd0cbb2f527 100755 (executable)
@@ -13,6 +13,10 @@ EOF
 exit 1;
 fi
 
+if [ -z "$VALGRIND" ]; then
+    export MALLOC_CHECK_=2
+fi
+
 server="$1"
 username="$2"
 password="$3"
@@ -40,7 +44,7 @@ for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
      esac
    for t in $tests; do
     echo Testing $t on $transport with $bindoptions
-    testit bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*"
+    testit $VALGRIND bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*"
    done
  done
 done
index a05bfb28b0318cb10c9726b71a25ed1a5a17fdba..fb94c043d4c98fd40cced439a01eeb108d97be2a 100755 (executable)
@@ -14,6 +14,10 @@ EOF
 exit 1;
 fi
 
+if [ -z "$VALGRIND" ]; then
+    export MALLOC_CHECK_=2
+fi
+
 server="$1"
 username="$2"
 password="$3"
@@ -23,7 +27,7 @@ shift 4
 testit() {
    trap "rm -f test.$$" EXIT
    cmdline="$*"
-   if ! $cmdline > test.$$ 2>&1; then
+   if ! $VALGRIND $cmdline > test.$$ 2>&1; then
        cat test.$$;
        rm -f test.$$;
        echo "TEST FAILED - $cmdline";