From: Joachim Breitner Date: Wed, 29 Jul 2009 11:23:16 +0000 (+0200) Subject: [tests] assert_grep_not function X-Git-Url: https://git.donarmstrong.com/?p=wannabuild.git;a=commitdiff_plain;h=c08b0e27b2710edde91420a346e83acb50560415 [tests] assert_grep_not function --- diff --git a/tests/tests.sh b/tests/tests.sh index b22cd02..d6da884 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -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 ]"