tests.am 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. tests/joy.at \
  51. $(EMPTY)
  52. # Joy source used by test modules
  53. TEST_JOYS = \
  54. tests/inicheck.joy \
  55. tests/test-base.joy \
  56. tests/test-forth.joy \
  57. $(EMPTY)
  58. $(TESTSUITE): $(srcdir)/tests/testsuite.at $(srcdir)/tests/local.at $(srcdir)/tests/package.m4 $(TEST_MODULES)
  59. $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)/tests' -o $@.tmp $<
  60. $(AM_V_at)mv $@.tmp $@
  61. tests/atconfig: $(top_builddir)/config.status
  62. cd $(top_builddir) && $(SHELL) ./config.status $@
  63. EXTRA_DIST += \
  64. tests/testsuite.at \
  65. tests/local.at \
  66. $(TESTSUITE) tests/atlocal.in \
  67. $(TEST_MODULES) \
  68. $(TEST_JOYS) \
  69. $(EMPTY)
  70. CLEANFILES += \
  71. tests/testsuite.log \
  72. $(EMPTY)
  73. DISTCLEANFILES += \
  74. tests/atconfig \
  75. $(EMPTY)