hello.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #! /bin/bash
  2. ## Copyright (C) 2017 Jeremiah Orians
  3. ## This file is part of Gnu Mes.
  4. ##
  5. ## Gnu Mes is free software: you can redistribute it and/or modify
  6. ## it under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation, either version 3 of the License, or
  8. ## (at your option) any later version.
  9. ##
  10. ## Gnu Mes is distributed in the hope that it will be useful,
  11. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ## GNU General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with Gnu Mes. If not, see <http://www.gnu.org/licenses/>.
  17. set -ux
  18. export MES_DEBUG=2
  19. export MES_ARENA=${MES_ARENA-100000000}
  20. export MES_STACK=${MES_STACK-500000}
  21. export MES_PREFIX=mes
  22. export MES=bin/mes-m2
  23. ${SCHEME-$MES} \
  24. --no-auto-compile\
  25. -e main\
  26. scripts/mescc.scm test/test200/hello.c -m 32 -o test/results/test200-binary &> test/test200/log
  27. r=$?
  28. [ $r = 0 ] || exit 1
  29. out=$(./test/results/test200-binary 2>&1)
  30. r=$?
  31. [ "$out" = "Hello, Mescc!" ] || exit 2
  32. [ $r = 42 ] || exit 3
  33. exit 0