check.am 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Variables to be defined:
  2. #
  3. # TEST_VERBOSE - set to 0 (default) or 1 to control test suite verbosity
  4. # TEST_ENV_VARS - environment variables to be set for the test suite
  5. # TEST_COVERAGE - set to the perl module in charge of getting test coverage
  6. # test_tmpdir - test suite temporary directory
  7. # test_scripts - list of test case scripts
  8. # test_programs - list of test case programs
  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", "$(top_srcdir)/dselect/methods" ], \
  14. color => 1, \
  15. verbosity => $(TEST_VERBOSE), \
  16. failures => 1, \
  17. }); \
  18. my $$aggregate = $$harness->runtests(@ARGV); \
  19. die "FAIL: test suite has errors\n" if $$aggregate->has_errors;'
  20. check-clean:
  21. [ -z "$(test_tmpdir)" ] || rm -fr $(test_tmpdir)
  22. check-local: $(test_data) $(test_programs) $(test_scripts)
  23. [ -z "$(test_tmpdir)" ] || $(MKDIR_P) $(test_tmpdir)
  24. PATH="$(abs_top_builddir)/src:$(abs_top_builddir)/scripts:$(abs_top_builddir)/utils:$(PATH)" \
  25. LC_ALL=C \
  26. DPKG_COLORS=never \
  27. $(TEST_ENV_VARS) \
  28. srcdir=$(srcdir) builddir=$(builddir) \
  29. CC=$(CC) \
  30. PERL=$(PERL) \
  31. PERL_DL_NONLAZY=1 \
  32. PERL5LIB=$(abs_top_srcdir)/scripts:$(abs_top_srcdir)/dselect/methods \
  33. PERL5OPT=$(TEST_COVERAGE) \
  34. $(PERL) -MTAP::Harness -e $(TEST_RUNNER) \
  35. $(addprefix $(builddir)/,$(test_programs)) \
  36. $(addprefix $(srcdir)/,$(test_scripts))