]> rtime.felk.cvut.cz Git - omk.git/blobdiff - tests/functions.sh
RTEMS rules: provide support to build application with symbols exported.
[omk.git] / tests / functions.sh
index 97f6679edff2af15fcb40fa956c2aadcd2cf35a6..8affc529f6aab5a0a01dae5175c6c84de3eff2ef 100644 (file)
@@ -1,6 +1,18 @@
 # -*-sh-*-
 
-function findup() {
+# Compatibility script for older (non-wvtest) test
+
+. ./wvtest.sh
+
+# Exit on the first error
+set -e
+
+if test -f ../../$(basename $0 .sh).files; then
+    WVPASS . ../../$(basename $0 .sh).files
+fi
+omkize
+
+findup() {
     local arg="$1"
     if test -z "$arg"; then return 1; fi
 
@@ -12,28 +24,17 @@ function findup() {
            exit 1
        fi
     done
-    
+
     echo $PWD/$arg
     cd $wd
 }
 
-function error() {
-    echo $1 > _error
-    exit 1
+error() {
+    _wvfind_caller
+    _wvcheck 1 "$1"
 }
 
-function canttest() {
-    echo $1 > _error
-    exit 2
+canttest() {
+    _wvfind_caller
+    _wvcheck 1 "$1 (cannot be test)"
 }
-
-if [ -z "$OMK_TESTSROOT" ]; then
-    # We are not called by tester.py - probably, a single test was
-    # executed by hand.
-
-    tester=$(findup tester.py)
-    python $tester                     # Run tester in the current
-                                       # directory
-    exit
-fi
-