test.sh.in 1006 B

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