[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)
Glenn Strauss 2 years ago
parent ff7cbcf5dd
commit 213373948a

@ -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->{PORT} = 2048;
my ($name, $aliases, $addrtype, $net) = gethostbyaddr(inet_aton(""), 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') {