# -*-sh-*-
-function error() {
- echo $1 > _error
- exit 1
+# 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
+
+ local wd=$PWD
+ while ! test -f "$arg"; do
+ cd ..
+ if test "$PWD" = "/"; then
+ cd $wd
+ exit 1
+ fi
+ done
+
+ echo $PWD/$arg
+ cd $wd
+}
+
+error() {
+ _wvfind_caller
+ _wvcheck 1 "$1"
}
-function canttest() {
- echo $1 > _error
- exit 2
+canttest() {
+ _wvfind_caller
+ _wvcheck 1 "$1 (cannot be test)"
}