From 213373948a412eb4a93d507bbff0b1483e62e2fc Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 9 Nov 2020 04:52:42 -0500 Subject: [tests] allow LIGHTTPD_EXE_PATH override allow LIGHTTPD_EXE_PATH override to be able to run source tree tests/*.t against installed executable, e.g. LIGHTTPD_EXE_PATH=/usr/sbin/lighttpd Beware that tests might not pass or might not be supported if the target executable is not the same version as that of the source tree (Possible use for this override is by Debian autopkgtests) --- tests/LightyTest.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/LightyTest.pm') diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index a11c5d8a..434b6b6c 100644 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -78,6 +78,9 @@ sub new { $self->{MODULES_PATH} = $self->{BASEDIR}.'/build'; } $self->{LIGHTTPD_PATH} = $self->{BINDIR}.'/lighttpd'; + if (exists $ENV{LIGHTTPD_EXE_PATH}) { + $self->{LIGHTTPD_PATH} = $ENV{LIGHTTPD_EXE_PATH}; + } $self->{PORT} = 2048; my ($name, $aliases, $addrtype, $net) = gethostbyaddr(inet_aton("127.0.0.1"), AF_INET); @@ -159,6 +162,7 @@ sub start_proc { $ENV{'PORT'} = $self->{PORT}; my @cmdline = ($self->{LIGHTTPD_PATH}, "-D", "-f", $self->{SRCDIR}."/".$self->{CONFIGFILE}, "-m", $self->{MODULES_PATH}); + splice(@cmdline, -2) if exists $ENV{LIGHTTPD_EXE_PATH}; if (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'strace') { @cmdline = (qw(strace -tt -s 4096 -o strace -f -v), @cmdline); } elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'truss') { -- cgit v1.2.1