tests.am 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Joy -- implementation of the Joy programming language
  2. # Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
  3. #
  4. # Joy is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU General Public License as published by the Free
  6. # Software Foundation; either version 3 of the License, or (at your
  7. # option) any later version.
  8. #
  9. # Joy is distributed in the hope that it will be useful, but WITHOUT
  10. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. # License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Joy. If not, see <http://www.gnu.org/licenses/>.
  16. # The `:;' works around a Bash 3.2 bug when the output is not writable.
  17. $(srcdir)/tests/package.m4: $(top_srcdir)/configure.ac
  18. $(AM_V_GEN):;{ \
  19. echo '# Signature of the current package.' && \
  20. echo 'm4_define([AT_PACKAGE_NAME],' && \
  21. echo ' [$(PACKAGE_NAME)])' && \
  22. echo 'm4_define([AT_PACKAGE_TARNAME],' && \
  23. echo ' [$(PACKAGE_TARNAME)])' && \
  24. echo 'm4_define([AT_PACKAGE_VERSION],' && \
  25. echo ' [$(PACKAGE_VERSION)])' && \
  26. echo 'm4_define([AT_PACKAGE_STRING],' && \
  27. echo ' [$(PACKAGE_STRING)])' && \
  28. echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
  29. echo ' [$(PACKAGE_BUGREPORT)])'; \
  30. echo 'm4_define([AT_PACKAGE_URL],' && \
  31. echo ' [$(PACKAGE_URL)])'; \
  32. } >'$@'
  33. TESTSUITE = $(srcdir)/testsuite
  34. check-local: tests/atconfig $(TESTSUITE) $(top_builddir)/pre-inst-env
  35. $(AM_V_at)$(top_builddir)/pre-inst-env $(SHELL) '$(TESTSUITE)' -C tests \
  36. $(filter -j%,$(MAKEFLAGS)) $(TESTSUITEFLAGS)
  37. installcheck-local: tests/atconfig $(TESTSUITE)
  38. $(AM_V_at)$(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH='$(bindir)' \
  39. $(filter -j%,$(MAKEFLAGS)) $(TESTSUITEFLAGS)
  40. clean-local:
  41. test ! -f '$(TESTSUITE)' || \
  42. $(SHELL) '$(TESTSUITE)' --clean
  43. AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
  44. AUTOTEST = $(AUTOM4TE) --language=autotest
  45. # Files included by testsuite.at
  46. TEST_MODULES = \
  47. tests/joy-base.at \
  48. tests/joy-forth.at \
  49. tests/joy-repl.at \
  50. $(EMPTY)
  51. # Joy source used by test modules
  52. TEST_JOYS = \
  53. tests/inicheck.joy \
  54. tests/test-base.joy \
  55. tests/test-forth.joy \
  56. $(EMPTY)
  57. $(TESTSUITE): $(srcdir)/tests/testsuite.at $(srcdir)/tests/package.m4 $(TEST_MODULES)
  58. $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)/tests' -o $@.tmp $<
  59. $(AM_V_at)mv $@.tmp $@
  60. tests/atconfig: $(top_builddir)/config.status
  61. cd $(top_builddir) && $(SHELL) ./config.status $@
  62. EXTRA_DIST += \
  63. tests/testsuite.at \
  64. $(srcdir)/tests/package.m4 \
  65. $(TESTSUITE) tests/atlocal.in \
  66. $(TEST_MODULES) \
  67. $(TEST_JOYS) \
  68. $(EMPTY)
  69. CLEANFILES += \
  70. tests/testsuite.log \
  71. $(EMPTY)
  72. DISTCLEANFILES += \
  73. tests/atconfig \
  74. $(EMPTY)