Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike@mikegerwitz.com>2014-06-14 00:34:25 -0400
committerMike Gerwitz <mike@mikegerwitz.com>2014-06-17 01:37:31 -0400
commit3ddf7f00e83f5109573f2307100f125a753c5f55 (patch)
tree3247f6b985a8971bdb84230e35e35e08ac5d2dab
parenta073da42f8d74cb81927a995d8e57a0789a99ccd (diff)
downloadpkgsh-3ddf7f00e83f5109573f2307100f125a753c5f55.tar.gz
pkgsh-3ddf7f00e83f5109573f2307100f125a753c5f55.tar.bz2
pkgsh-3ddf7f00e83f5109573f2307100f125a753c5f55.zip
`assert` added to test runner
-rwxr-xr-xtest/run-test16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/run-test b/test/run-test
index d8e4873..1528f56 100755
--- a/test/run-test
+++ b/test/run-test
@@ -29,6 +29,22 @@ cd "$( dirname "$0" )/../" || {
}
+##
+# Provide command to output assertion on failure
+#
+# We do not override the `test` builtin, as this would also affect pkgsh
+# itself.
+#
+assert()
+{
+ test "$@" || {
+ local -i code=$?
+ echo "assertion failed: $@" >&2
+ return $code
+ }
+}
+
+
main()
{
local tpath="$1"