summaryrefslogtreecommitdiff
path: root/tests/LightyTest.pm
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-11-09 04:52:42 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-11-09 05:07:05 -0500
commit213373948a412eb4a93d507bbff0b1483e62e2fc (patch)
treeefc6ad7a82dd3d3e69572e9a2639cfd90ed8e063 /tests/LightyTest.pm
parentff7cbcf5dd6b4ad3eb345ac4d7976670547d1465 (diff)
downloadlighttpd-git-213373948a412eb4a93d507bbff0b1483e62e2fc.tar.gz
[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)
Diffstat (limited to 'tests/LightyTest.pm')
-rw-r--r--tests/LightyTest.pm4
1 files changed, 4 insertions, 0 deletions
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') {