tester.in 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! /bin/sh
  2. # file : tester.in
  3. # copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC
  4. # license : MIT; see accompanying LICENSE file
  5. #
  6. # Run test or example. The test driver is in the current directory.
  7. # The data files, if any, are in $srcdir. If $example is set, then
  8. # we are testing an example and no output verification is required.
  9. #
  10. # Globbing returns files in alphabetic order.
  11. #
  12. files=`echo $srcdir/*.xml`
  13. if test "$files" != "$srcdir/*.xml"; then
  14. for f in $files; do
  15. echo ./driver $f
  16. if test -n "$example"; then
  17. ./driver $f
  18. else
  19. ./driver $f >test.out
  20. fi
  21. if test $? -ne 0; then
  22. rm -f test.out
  23. exit 1
  24. fi
  25. if test -z "$example"; then
  26. @DIFF@ @DIFFFLAGS@ $f test.out
  27. r=$?
  28. rm -f test.out
  29. if test $r -ne 0; then
  30. exit 1
  31. fi
  32. fi
  33. done
  34. else
  35. echo ./driver
  36. ./driver
  37. fi