`assert` added to test runner
parent
a073da42f8
commit
3ddf7f00e8
|
@ -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()
|
main()
|
||||||
{
|
{
|
||||||
local tpath="$1"
|
local tpath="$1"
|
||||||
|
|
Loading…
Reference in New Issue