BIND 10 trac614, updated. ddd04eed61f4945303400569629d66cf685833d2 [trac614] First cut at an ugly script

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Feb 24 18:12:52 UTC 2011


The branch, trac614 has been updated
       via  ddd04eed61f4945303400569629d66cf685833d2 (commit)
      from  586df2b37d5f26ac1998d12c86f280b11bf077b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ddd04eed61f4945303400569629d66cf685833d2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Feb 24 19:10:02 2011 +0100

    [trac614] First cut at an ugly script
    
    It produces the output, but fails at the end reporting the status, needs
    at last some documentation, etc. It might leave some files after the
    run. It doesn't handle some parameters properly (problems with
    escaping).
    
    It is a big ugly bash script. But as it is to be used by the developers,
    not users, it might not be so big problem.

-----------------------------------------------------------------------

Summary of changes:
 tools/tests_in_valgrind.sh |   55 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100755 tools/tests_in_valgrind.sh

-----------------------------------------------------------------------
diff --git a/tools/tests_in_valgrind.sh b/tools/tests_in_valgrind.sh
new file mode 100755
index 0000000..ccbe821
--- /dev/null
+++ b/tools/tests_in_valgrind.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Yes, really bash, there are some bashisms
+
+# First, make sure the tests are up to date
+make
+
+if [ $? = 2 ] ; then
+    echo "Did you run configure? Do you call me from the top bind10 directory?" >&2
+    exit 1
+fi
+
+set -ex
+
+# Some configuration
+# TODO Escape for sed, this might break
+LOGFILE="${VALGRIND_FILE:-valgrind.log}"
+FLAGS="${VALGRIND_FLAGS:---read-var-info=yes --leak-check=full}"
+FLAGS="$FLAGS --log-file=$LOGFILE.%p"
+
+FOUND_ANY=false
+FAILED=
+
+# Find all the tests (yes, doing it by a name is a nasty hack)
+# Since the while runs in a subprocess, we need to get the assignments out, done by the eval
+eval $(find . -type f -executable -name run_unittests -print | grep -v '\.libs/run_unittests$' | while read testname ; do
+    sed -e 's#exec "#exec valgrind '"$FLAGS"' "#' "$testname" > "$testname.valgrind"
+    chmod +x "$testname.valgrind"
+    echo "$testname" >>"$LOGFILE"
+    echo "===============" >>"$LOGFILE"
+    "$testname.valgrind" >&2 &
+    PID="$!"
+    wait "$PID"
+    CODE="$?"
+    if [ "$CODE" != 0 ] ; then
+        echo 'FAILED="$FAILED
+'"'$testname'"
+    fi
+    NAME="$LOGFILE.$PID"
+    rm "$testname.valgrind"
+    # Remove the ones from death tests
+    grep "==$PID==" "$NAME" >>"$LOGFILE"
+    rm "$NAME"
+    echo 'FOUND_ANY=true'
+done)
+
+if [ -n "$FAILED" ] ; then
+    echo "These tests failed:" >&2
+    echo "$FAILED" >&2
+fi
+
+if ! $FOUND_ANY ; then
+    echo "No test was found. It is possible you configured witouth --with-gtest or you run it from wrong directory" >&2
+    exit 1
+fi




More information about the bind10-changes mailing list