Home | History | Annotate | Download | only in test
      1 #!/bin/sh
      2 
      3 case @abi@ in
      4   macho)
      5     export DYLD_FALLBACK_LIBRARY_PATH="@objroot@lib"
      6     ;;
      7   pecoff)
      8     export PATH="${PATH}:@objroot@lib"
      9     ;;
     10   *)
     11     ;;
     12 esac
     13 
     14 # Corresponds to test_status_t.
     15 pass_code=0
     16 skip_code=1
     17 fail_code=2
     18 
     19 pass_count=0
     20 skip_count=0
     21 fail_count=0
     22 for t in $@; do
     23   if [ $pass_count -ne 0 -o $skip_count -ne 0 -o $fail_count != 0 ] ; then
     24     echo
     25   fi
     26   echo "=== ${t} ==="
     27   ${t}@exe@ @abs_srcroot@ @abs_objroot@
     28   result_code=$?
     29   case ${result_code} in
     30     ${pass_code})
     31       pass_count=$((pass_count+1))
     32       ;;
     33     ${skip_code})
     34       skip_count=$((skip_count+1))
     35       ;;
     36     ${fail_code})
     37       fail_count=$((fail_count+1))
     38       ;;
     39     *)
     40       echo "Test harness error" 1>&2
     41       exit 1
     42   esac
     43 done
     44 
     45 total_count=`expr ${pass_count} + ${skip_count} + ${fail_count}`
     46 echo
     47 echo "Test suite summary: pass: ${pass_count}/${total_count}, skip: ${skip_count}/${total_count}, fail: ${fail_count}/${total_count}"
     48 
     49 if [ ${fail_count} -eq 0 ] ; then
     50   exit 0
     51 else
     52   exit 1
     53 fi
     54