check.am 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. }); \
  17. $$harness->runtests(@ARGV);'
  18. check-clean:
  19. [ -z "$(test_tmpdir)" ] || rm -fr $(test_tmpdir)
  20. check-local: $(test_data) $(test_cases)
  21. [ -z "$(test_tmpdir)" ] || $(MKDIR_P) $(test_tmpdir)
  22. PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(top_builddir)/utils:$(PATH)" \
  23. LC_ALL=C \
  24. $(TEST_ENV_VARS) \
  25. srcdir=$(srcdir) builddir=$(builddir) \
  26. PERL_DL_NONLAZY=1 \
  27. PERL5OPT=$(TEST_COVERAGE) \
  28. $(PERL) -MTAP::Harness -e $(TEST_RUNNER) \
  29. $(if $(TEST_PREFIX), \
  30. $(addprefix $(TEST_PREFIX)/,$(test_cases)), \
  31. $(addprefix $(srcdir)/,$(test_cases)))