]> rtime.felk.cvut.cz Git - omk.git/blob - tests/functions.sh
Update wvtool
[omk.git] / tests / functions.sh
1 # -*-sh-*-
2
3 # Compatibility script for older (non-wvtest) test
4
5 . ./wvtest.sh
6
7 # Exit on the first error
8 set -e
9
10 if test -f ../../$(basename $0 .sh).files; then
11     WVPASS . ../../$(basename $0 .sh).files
12 fi
13 omkize
14
15 findup() {
16     local arg="$1"
17     if test -z "$arg"; then return 1; fi
18
19     local wd=$PWD
20     while ! test -f "$arg"; do
21         cd ..
22         if test "$PWD" = "/"; then
23             cd $wd
24             exit 1
25         fi
26     done
27
28     echo $PWD/$arg
29     cd $wd
30 }
31
32 error() {
33     _wvfind_caller
34     _wvcheck 1 "$1"
35 }
36
37 canttest() {
38     _wvfind_caller
39     _wvcheck 1 "$1 (cannot be test)"
40 }