summaryrefslogtreecommitdiff
path: root/check.am
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-04-28 06:24:46 +0200
committerGuillem Jover <guillem@debian.org>2014-04-28 13:23:08 +0200
commit34b26c7db232b300991df5fb6f52707b381df28f (patch)
tree1c7097f42aacca91968a6c5defc0aaa07ce0f633 /check.am
parent15c4eb9f7223dcc309b46ba89b2b3081e2f9a2a7 (diff)
downloaddpkg-34b26c7db232b300991df5fb6f52707b381df28f.tar.gz
build: Switch test runner from Test::Harness to TAP::Harness
The latter is the recommended module for new code, the former being just a compatibility wrapper around it. And it will allow to set more detailed options for the harness that are not exposed through the Test::Harness wrapper. We use a make variable instead of inlining the perl code in the make recipe due to the way make escapes backslashes inside single-quotes in recipes, which disturbs the semantics of the perl code.
Diffstat (limited to 'check.am')
-rw-r--r--check.am14
1 files changed, 10 insertions, 4 deletions
diff --git a/check.am b/check.am
index 1d5d76f67..46afec79f 100644
--- a/check.am
+++ b/check.am
@@ -9,6 +9,14 @@
TEST_VERBOSE ?= 0
+TEST_RUNNER = '\
+ my $$harness = TAP::Harness->new({ \
+ lib => [ "$(top_srcdir)/scripts" ], \
+ color => 1, \
+ verbosity => $(TEST_VERBOSE), \
+ }); \
+ $$harness->runtests(@ARGV);'
+
check-clean:
[ -z "$(test_tmpdir)" ] || rm -fr $(test_tmpdir)
@@ -17,10 +25,8 @@ check-local: $(test_data) $(test_cases)
PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(top_builddir)/utils:$(PATH)" \
LC_ALL=C \
$(TEST_ENV_VARS) \
- HARNESS_VERBOSE=$(TEST_VERBOSE) HARNESS_COLOR=1 \
srcdir=$(srcdir) builddir=$(builddir) \
- PERL5LIB=$(top_srcdir)/scripts PERL_DL_NONLAZY=1 \
+ PERL_DL_NONLAZY=1 \
PERL5OPT=$(TEST_COVERAGE) \
- $(PERL) -I$(top_srcdir)/scripts \
- -MTest::Harness -e 'Test::Harness::runtests(@ARGV)' \
+ $(PERL) -MTAP::Harness -e $(TEST_RUNNER) \
$(addprefix $(srcdir)/,$(test_cases))