/test/test_all.sh

http://github.com/tybor/Liberty · Shell · 34 lines · 16 code · 4 blank · 14 comment · 4 complexity · 7bcaf275c9c9c6eab77e4540870e7aea MD5 · raw file

  1. #!/usr/bin/env bash
  2. # Nominal usage:
  3. # --------------
  4. # $ ./test_all.sh
  5. #
  6. # Example of specific usage:
  7. # --------------------------
  8. # $ cd language/agent
  9. # $ INTERPRETER=libertyi LOG=trace CHECK=require ../../test_all.sh
  10. #
  11. # Example of specific test call:
  12. # ------------------------------
  13. # $ cd language/agent
  14. # $ INTERPRETER=libertyi LOG=trace CHECK=all DEBUG=-debug ../../test_all.sh test_agent01.e
  15. ROOT=$(pwd)
  16. cd $(dirname $0)/..
  17. export LIBERTY_HOME=$(pwd)
  18. export INTERPRETER=${INTERPRETER:-libertyi}
  19. export LIBERTY_INTERPRETER=${LIBERTY_INTERPRETER:-$LIBERTY_HOME/target/bin/$INTERPRETER.d/$INTERPRETER}
  20. export LOG=${LOG:-error}
  21. export CHECK=${CHECK:-all}
  22. export DEBUG=${DEBUG:-}
  23. if [ x"$1" == x ]; then
  24. find $ROOT -name test_\*.e -exec $LIBERTY_HOME/work/do_test.sh {} -log=$LOG -check=$CHECK $DEBUG \;
  25. else
  26. while [ x"$1" != x ]; do
  27. find $ROOT -name "$1" -exec $LIBERTY_HOME/work/do_test.sh {} -log=$LOG -check=$CHECK $DEBUG \;
  28. shift
  29. done
  30. fi