tests for -e, --exit-on-fail

This commit is contained in:
Thomas Levine 2016-02-28 19:43:32 +00:00
parent b6706fcc00
commit 22e4ff4cc3
9 changed files with 7 additions and 5 deletions

View File

@ -1,11 +1,11 @@
tmp=$(mktemp)
../urchin -e -f ./.die-on-fail > $tmp
#!/bin/sh
../../urchin -e ./.test_-e,--exit-on-fail > $tmp
result=$?
set -e
grep '1 should run.' $tmp
grep '2 should run.' $tmp
grep -v '3 should not run.' $tmp
grep -v '4 should not run.' $tmp
rm $tmp
exit $result

1
tests/Flags/setup Normal file
View File

@ -0,0 +1 @@
export tmp=$(mktemp)

1
tests/Flags/teardown Normal file
View File

@ -0,0 +1 @@
rm $tmp

2
urchin
View File

@ -492,7 +492,7 @@ fi
# Run or present the Molly guard.
root="$(urchin_root "$1")"
if basename "$(fullpath "$root")" |
grep -Fi 'test' > /dev/null || $force; then
grep -i 'test' > /dev/null || $force; then
start=$(date +%s)
set +e