From 8eddb040f95b7e6a2ebb4700c4518e76b7c5b294 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 28 May 2019 18:48:36 +0000 Subject: Make it possible to reuse t/*.t for autopkgtest During build (target "check"), PATH and DH_AUTOSCRIPTDIR are set in a way, that tests use dh_runit(1) and maintainer script snippets from current directory. Target "autopkgtest" uses dh_runit, globally installed in system. --- Makefile | 2 ++ T.pm | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 46acb19..2f77795 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ all: check: + PATH=$(CURDIR):$(PATH) DH_AUTOSCRIPTDIR=$(CURDIR) prove -I. +autopkgtest: prove -I. .PHONY: check diff --git a/T.pm b/T.pm index 4178fd8..4cc407e 100644 --- a/T.pm +++ b/T.pm @@ -10,8 +10,6 @@ our @ISA = qw(Exporter); our @EXPORT = qw(system_ok); my $root = Cwd::cwd; -$ENV{PATH} = "$root:$ENV{PATH}"; -$ENV{DH_AUTOSCRIPTDIR} = $root; die '$0 does not match expected format' unless ($0 =~ m#t/([0-9]+)\.t#); -- cgit v1.2.3