dotest.sh 866 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. (cd ..; make mxmldoc-static)
  3. files=""
  4. mode=""
  5. while test $# -gt 0; do
  6. arg="$1"
  7. shift
  8. case "$arg" in
  9. -f) framed="--framed framed" ;;
  10. -g) mode="gdb" ;;
  11. -v) mode="valgrind" ;;
  12. *.h | *.c | *.cxx) files="$files $arg" ;;
  13. *)
  14. echo "Usage: ./dotest.sh [-f] [-g] [-v] [files]"
  15. exit 1
  16. ;;
  17. esac
  18. done
  19. if test "$files" = ""; then
  20. files=*.cxx
  21. fi
  22. rm -f test.xml
  23. case "$mode" in
  24. gdb)
  25. echo "break malloc_error_break" >.gdbcmds
  26. echo "set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib" >>.gdbcmds
  27. echo "run $framed test.xml $files >test.html 2>test.log" >>.gdbcmds
  28. gdb -x .gdbcmds ../mxmldoc-static
  29. ;;
  30. valgrind)
  31. valgrind --log-fd=3 --leak-check=yes \
  32. ../mxmldoc-static $framed test.xml $files \
  33. >test.html 2>test.log 3>test.valgrind
  34. ;;
  35. *)
  36. ../mxmldoc-static $framed test.xml $files >test.html 2>test.log
  37. ;;
  38. esac