Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #!/bin/sh
      2  1.1  christos 
      3  1.1  christos #set -x
      4  1.1  christos 
      5  1.1  christos if [ $# -ne 1 ]; then
      6  1.1  christos 	echo "usage: $0 test-name" >&2
      7  1.1  christos 	exit 1
      8  1.1  christos fi
      9  1.1  christos 
     10  1.1  christos if [ x$KEA4 = x ]; then
     11  1.1  christos 	echo "KEA4 is not set" >&2
     12  1.1  christos fi
     13  1.1  christos if [ x$KEA6 = x ]; then
     14  1.1  christos 	echo "KEA6 is not set" >&2
     15  1.1  christos fi
     16  1.1  christos 
     17  1.1  christos file=$1
     18  1.1  christos 
     19  1.1  christos cd "$(dirname "$0")"
     20  1.1  christos 
     21  1.1  christos isout=$(expr $file : ".*\.out")
     22  1.1  christos if [ $isout -eq 0 ]; then
     23  1.1  christos 	full=$file.out
     24  1.1  christos else
     25  1.1  christos 	full=$file
     26  1.1  christos fi
     27  1.1  christos if [ ! -f $full ]; then
     28  1.1  christos 	echo "can't find $file" >&2
     29  1.1  christos 	exit 1
     30  1.1  christos fi
     31  1.1  christos 
     32  1.1  christos is4=$(expr $file : ".*4")
     33  1.1  christos is6=$(expr $file : ".*6")
     34  1.1  christos if [ \( $is4 -eq 0 \) -a \( $is6 -eq 0 \) ]; then
     35  1.1  christos 	echo "can't get version from $file" >&2
     36  1.1  christos 	exit 1
     37  1.1  christos fi
     38  1.1  christos 
     39  1.1  christos base=$(basename $full .out)
     40  1.1  christos log=/tmp/$base.log$$
     41  1.1  christos if [ $is4 -ne 0 ]; then
     42  1.1  christos 	$KEA4 -t $full >& $log
     43  1.1  christos 	if [ $? -ne 0 ]; then
     44  1.1  christos 		echo "$full raised an error" >&2
     45  1.1  christos 		exit 1
     46  1.1  christos 	fi
     47  1.1  christos fi
     48  1.1  christos if [ $is6 -ne 0 ]; then
     49  1.1  christos 	$KEA6 -t $full >& $log
     50  1.1  christos 	if [ $? -ne 0 ]; then
     51  1.1  christos 		echo "$full raised an error" >&2
     52  1.1  christos 		exit 1
     53  1.1  christos 	fi
     54  1.1  christos fi
     55