From f2d63b2953bf4df6b2649aef4e8fa36cac031716 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Mon, 25 Jan 2016 14:14:13 +0000 Subject: [PATCH] Test die on fail. --- tests/.die-on-fail/1 should run. | 0 tests/.die-on-fail/2 should run. | 1 + tests/.die-on-fail/3 should not run. | 1 + tests/.die-on-fail/4 should not run. | 1 + tests/Die on fail. | 11 +++++++++++ 5 files changed, 14 insertions(+) create mode 100755 tests/.die-on-fail/1 should run. create mode 100755 tests/.die-on-fail/2 should run. create mode 100755 tests/.die-on-fail/3 should not run. create mode 100755 tests/.die-on-fail/4 should not run. create mode 100755 tests/Die on fail. diff --git a/tests/.die-on-fail/1 should run. b/tests/.die-on-fail/1 should run. new file mode 100755 index 0000000..e69de29 diff --git a/tests/.die-on-fail/2 should run. b/tests/.die-on-fail/2 should run. new file mode 100755 index 0000000..c508d53 --- /dev/null +++ b/tests/.die-on-fail/2 should run. @@ -0,0 +1 @@ +false diff --git a/tests/.die-on-fail/3 should not run. b/tests/.die-on-fail/3 should not run. new file mode 100755 index 0000000..c508d53 --- /dev/null +++ b/tests/.die-on-fail/3 should not run. @@ -0,0 +1 @@ +false diff --git a/tests/.die-on-fail/4 should not run. b/tests/.die-on-fail/4 should not run. new file mode 100755 index 0000000..c508d53 --- /dev/null +++ b/tests/.die-on-fail/4 should not run. @@ -0,0 +1 @@ +false diff --git a/tests/Die on fail. b/tests/Die on fail. new file mode 100755 index 0000000..d9c3d22 --- /dev/null +++ b/tests/Die on fail. @@ -0,0 +1,11 @@ +tmp=$(mktemp) +../urchin -e -f ./.die-on-fail > $tmp +result=$? + +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