Просмотр исходного кода

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.
Guillem Jover лет назад: 12
Родитель
Сommit
34b26c7db2
2 измененных файлов с 11 добавлено и 4 удалено
  1. 10 4
      check.am
  2. 1 0
      debian/changelog

+ 10 - 4
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))

+ 1 - 0
debian/changelog

@@ -11,6 +11,7 @@ dpkg (1.17.8) UNRELEASED; urgency=low
     supports command in the man page. Closes: #739634
   * Improve wording for «dpkg --verify» and --verify-format in the man page.
     Closes: #733057
+  * Switch test runner from Test::Harness to TAP::Harness.
 
   [ Updated programs translations ]
   * German (Sven Joachim).