]> git.donarmstrong.com Git - wannabuild.git/commitdiff
[tests] assert_grep_not function
authorJoachim Breitner <nomeata@debian.org>
Wed, 29 Jul 2009 11:23:16 +0000 (13:23 +0200)
committerJoachim Breitner <nomeata@debian.org>
Wed, 29 Jul 2009 11:33:56 +0000 (13:33 +0200)
tests/tests.sh

index b22cd02480d73d79635c3461bbd069c956e33876..d6da8842f1e756fbe6ce841743c644b8502dc28a 100755 (executable)
@@ -36,6 +36,18 @@ function assert_grep {
        fi
 }
 
+function assert_grep_not {
+       cat > $testdir/assert_grep
+       if grep -q "$1" $testdir/assert_grep 
+       then
+         echo "Could find unexpected \"$1\" in:"
+         cat $testdir/assert_grep
+         # We are in a pipe, i.e. a subshell, so kill the parent 
+         kill -TERM $parent_pid
+         exit 1
+       fi
+}
+
 cd "$(dirname $0)"/..
 
 assert "[ -e bin/wanna-build ]"