]> git.ozlabs.org Git - petitboot/blobdiff - test/urls/run-url-test.in
discover/grub2: Use parser for a single parse
[petitboot] / test / urls / run-url-test.in
index 834166f9e4cf8f7dcef595e4bdb540d23dbed155..c98fe8b660684894014db046f1819de2fa1a7b76 100755 (executable)
@@ -1,5 +1,12 @@
 #!/bin/bash
 
 #!/bin/bash
 
+valgrind=''
+if [ "$1" = "--valgrind" ]
+then
+       shift
+       valgrind='valgrind --leak-check=full --error-exitcode=1'
+fi
+
 parser="@abs_builddir@/parse-url"
 testfile=$1
 
 parser="@abs_builddir@/parse-url"
 testfile=$1
 
@@ -8,7 +15,7 @@ url=$(head -n1 $testfile)
 tmp=$(mktemp)
 trap "rm $tmp" EXIT
 
 tmp=$(mktemp)
 trap "rm $tmp" EXIT
 
-$parser $url > $tmp
+$valgrind $parser $url > $tmp
 if test $? -ne 0
 then
        echo "Error running $parser on $testfile"
 if test $? -ne 0
 then
        echo "Error running $parser on $testfile"