run-suites 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. while [ -n "$1" ]; do
  3. suite=$1
  4. if [ -x $top_srcdir/test/suites/$suite/run ]; then
  5. SUITES="$SUITES $suite"
  6. else
  7. echo "No such suite: $suite"
  8. exit 1
  9. fi
  10. shift
  11. done
  12. if [ -z "$SUITES" ]; then
  13. suitedirs=$top_srcdir/test/suites/*
  14. for suitedir in $suitedirs; do
  15. if [ -d $suitedir ]; then
  16. SUITES="$SUITES `basename $suitedir`"
  17. fi
  18. done
  19. fi
  20. [ -z "$STOP" ] && STOP=0
  21. suites_srcdir=$top_srcdir/test/suites
  22. suites_builddir=suites
  23. scriptdir=$top_srcdir/test/scripts
  24. logdir=logs
  25. bindir=bin
  26. export suites_srcdir suites_builddir scriptdir logdir bindir
  27. passed=0
  28. failed=0
  29. for suite in $SUITES; do
  30. echo "Suite: $suite"
  31. if $suites_srcdir/$suite/run $suite; then
  32. passed=`expr $passed + 1`
  33. else
  34. failed=`expr $failed + 1`
  35. [ $STOP -eq 1 ] && break
  36. fi
  37. done
  38. if [ $failed -gt 0 ]; then
  39. echo "$failed of `expr $passed + $failed` test suites failed"
  40. exit 1
  41. else
  42. echo "$passed test suites passed"
  43. rm -rf $logdir
  44. fi