123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #! /bin/sh
- set -u
- test_name=INVALID.NAME
- log_file=BAD.LOG
- trs_file=BAD.TRS
- while test $# -gt 0; do
- case $1 in
- --test-name) test_name=$2; shift;;
- --log-file) log_file=$2; shift;;
- --trs-file) trs_file=$2; shift;;
-
- --expect-failure) shift;;
- --color-tests) shift;;
- --enable-hard-errors) shift;;
-
- --) shift; break;;
-
- *) echo "$0: invalid option/argument: '$1'" >&2; exit 2;;
- esac
- shift
- done
- {
- echo "RUN: $test_name"
- echo "RUN: $test_name" | sed 's/./=/g'
- echo
- } > $log_file
- "$@" 2>&1 | tee -a $log_file | (
- i=0 st=0
- exec 5> $trs_file
- while read line; do
- result=
- case $line in
- PASS:*) result=PASS ;;
- FAIL:*) result=FAIL ;;
- XPASS:*) result=XPASS ;;
- XFAIL:*) result=XFAIL ;;
- SKIP:*) result=SKIP ;;
- ERROR:*) result=ERROR ;;
- esac
- if test -n "$result"; then
- case $result in FAIL|XPASS|ERROR) st=1;; esac
-
- echo "$result: $test_name"
-
- echo ":test-result: $line" >&5
- echo >&5
- fi
- done
- if test $st -eq 0; then
- recheck=no
- copy_in_global_log=no
- else
- recheck=yes
- copy_in_global_log=yes
- fi
- echo ":recheck: $recheck" >&5
- echo ":copy-in-global-log: $copy_in_global_log" >&5
- exec 5>&-
- ) | awk '{ print $0 ", testcase " NR }'
- exit 0
|