chiark / gitweb /
awful debugging hacking
[dpkg] / check.am
1 # Variables to be defined:
2 #
3 #  TEST_VERBOSE - set to 0 (default) or 1 to control test suite verbosity
4 #  TEST_PARALLEL - set to 1 (default) or N to control the parallel jobs
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_scripts - list of test case scripts
9 #  test_programs - list of test case programs
10 #  test_data - list of test data files
11
12 TEST_VERBOSE ?= 0
13 TEST_PARALLEL ?= 1
14
15 TEST_RUNNER = '\
16         my $$harness = TAP::Harness->new({ \
17             exec => sub { my (undef, $$test) = @_; \
18                 return [ $$test ] if $$test !~ "\.t\$$" and -x $$test; \
19                 return }, \
20             lib => [ "$(top_srcdir)/scripts", "$(top_srcdir)/dselect/methods"  ], \
21             color => 1, \
22             verbosity => $(TEST_VERBOSE), \
23             jobs => $(TEST_PARALLEL), \
24             failures => 1, \
25         }); \
26         my $$aggregate = $$harness->runtests(@ARGV); \
27         die "FAIL: test suite has errors\n" if $$aggregate->has_errors;'
28
29 check-clean:
30         [ -z "$(test_tmpdir)" ] || rm -fr $(test_tmpdir)
31
32 check-local: $(test_data) $(test_programs) $(test_scripts)
33         [ -z "$(test_tmpdir)" ] || $(MKDIR_P) $(test_tmpdir)
34         PATH="$(abs_top_builddir)/src:$(abs_top_builddir)/scripts:$(abs_top_builddir)/utils:$(PATH)" \
35           LC_ALL=C \
36           DPKG_COLORS=never \
37           $(TEST_ENV_VARS) \
38           srcdir=$(srcdir) builddir=$(builddir) \
39           CC=$(CC) \
40           PERL=$(PERL) \
41           PERL_DL_NONLAZY=1 \
42           PERL5LIB=$(abs_top_srcdir)/scripts:$(abs_top_srcdir)/dselect/methods \
43           PERL5OPT=$(TEST_COVERAGE) \
44           $(PERL) -MTAP::Harness -e $(TEST_RUNNER) \
45             $(addprefix $(builddir)/,$(test_programs)) \
46             $(addprefix $(srcdir)/,$(test_scripts))