self-test 934 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # self-test - shell wrapper for performing self test
  4. #
  5. # Written in 2015-2021 by Alex Vong <alexvong1995 AT protonmail DOT 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 <https://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=`expr "x$0" : 'x\(.*\)/[^/]*'`/../
  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