self-test.test 937 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # self_test.test - shell wrapper for performing self test
  4. #
  5. # Written in 2015-2017 by Alex Vong <alexvong1995@gmail.com>
  6. #
  7. # To the extent possible under law, the author(s) have dedicated all copyright
  8. # and related and neighboring rights to this software to the public domain
  9. # worldwide. This software is distributed without any warranty.
  10. #
  11. # You should have received a copy of the CC0 Public Domain Dedication along
  12. # with this software.
  13. # If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
  14. # Use error
  15. set -e
  16. # Obtain MLUCAS_PATH by tranforming `foo/bar' to `foo/'
  17. # Otherwise, assume it is the current working directory
  18. case "$0" in
  19. */*)
  20. MLUCAS_PATH=`printf '%s' "$0" | sed -e 's/\/[^\/]*$/\//g'`
  21. ;;
  22. *)
  23. MLUCAS_PATH='./'
  24. ;;
  25. esac
  26. # Export MLUCAS_PATH so that mlucas.cfg stays in the build directory
  27. export MLUCAS_PATH
  28. # Do self-test
  29. exec "$MLUCAS_PATH"mlucas -s m