check.am 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Variables to be defined:
  2. #
  3. # TEST_PREFIX - set to the path to prefix to each test case for execution
  4. # TEST_VERBOSE - set to 0 (default) or 1 to control test suite verbosity
  5. # TEST_ENV_VARS - environment variables to be set for the test suite
  6. # TEST_COVERAGE - set to the perl module in charge of getting test coverage
  7. # test_tmpdir - test suite temporary directory
  8. # test_cases - list of test case files
  9. # test_data - list of test data files
  10. TEST_VERBOSE ?= 0
  11. TEST_RUNNER = '\
  12. my $$harness = TAP::Harness->new({ \
  13. lib => [ "$(top_srcdir)/scripts" ], \
  14. color => 1, \
  15. verbosity => $(TEST_VERBOSE), \
  16. failures => 1, \
  17. }); \
  18. $$harness->runtests(@ARGV);'
  19. check-clean:
  20. [ -z "$(test_tmpdir)" ] || rm -fr $(test_tmpdir)
  21. check-local: $(test_data) $(test_cases)
  22. [ -z "$(test_tmpdir)" ] || $(MKDIR_P) $(test_tmpdir)
  23. PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(top_builddir)/utils:$(PATH)" \
  24. LC_ALL=C \
  25. $(TEST_ENV_VARS) \
  26. srcdir=$(srcdir) builddir=$(builddir) \
  27. PERL_DL_NONLAZY=1 \
  28. PERL5OPT=$(TEST_COVERAGE) \
  29. $(PERL) -MTAP::Harness -e $(TEST_RUNNER) \
  30. $(if $(TEST_PREFIX), \
  31. $(addprefix $(TEST_PREFIX)/,$(test_cases)), \
  32. $(addprefix $(srcdir)/,$(test_cases)))