Browse Source

[tests] has_feature() helper func

has_feature() helper func so that tests
can be skipped if support is not present
personal/stbuehler/ci-build
Glenn Strauss 3 years ago
parent
commit
da6a94efbb
  1. 13
      tests/LightyTest.pm

13
tests/LightyTest.pm

@ -444,4 +444,17 @@ sub endspawnfcgi {
return 0;
}
sub has_feature {
# quick-n-dirty crude parse of "lighttpd -V"
# (XXX: should be run on demand and only once per instance, then cached)
my ($self, $feature) = @_;
my $FH;
open($FH, "-|",$self->{LIGHTTPD_PATH}, "-V") || return 0;
while (<$FH>) {
return ($1 eq '+') if (/([-+]) \Q$feature\E/);
}
close $FH;
return 0;
}
1;

Loading…
Cancel
Save