]> rtime.felk.cvut.cz Git - omk.git/blobdiff - tests/functions.sh
Merge branch 'devel-cherrypick'
[omk.git] / tests / functions.sh
index 97f6679edff2af15fcb40fa956c2aadcd2cf35a6..6962ed26818a71a350533dd136398c445706e77d 100644 (file)
@@ -1,6 +1,9 @@
 # -*-sh-*-
 
-function findup() {
+# Exit on first error
+set -e
+
+findup() {
     local arg="$1"
     if test -z "$arg"; then return 1; fi
 
@@ -17,14 +20,14 @@ function findup() {
     cd $wd
 }
 
-function error() {
+error() {
     echo $1 > _error
     exit 1
 }
 
-function canttest() {
-    echo $1 > _error
-    exit 2
+canttest() {
+    [ -f _canttest ] || echo $1 > _canttest
+    exit 1
 }
 
 if [ -z "$OMK_TESTSROOT" ]; then