X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=test%2Ftests.sh;h=15a4744a152e6448ed5a18249eca9ec45e20ac8f;hp=52f138411d3659728c24c38cc73790a65f0acd37;hb=289e14f9fa5472589b85bdae102aece71d858ecd;hpb=a51c515dc1cdf93edb89484238259c941da8f3b6 diff --git a/test/tests.sh b/test/tests.sh index 52f1384..15a4744 100644 --- a/test/tests.sh +++ b/test/tests.sh @@ -40,6 +40,23 @@ assertSameFile() { echo "----" } } +assertNotSegFault() +{ + [ $1 -eq 139 ] && fail "Returned with 139: segmentation fault (SIGSEGV)!!!" +} +assertNotIllegal() +{ + [ $1 -eq 132 ] && fail "Returned with 132: Illegal instruction (SIGILL)!!!" +} +assertFailWithNoReturn() { + local test="$1" + value=$( $test ) + rv=$? + assertFalse "'$test' does not fail" $rv + assertNotSegFault $rv + assertNotIllegal $rv + assertNull "'$test' returns '$value'" "$value" +} EOF for suite in $(ls ${SCRIPTS_DIR}/*)