diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-21 13:25:07 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-21 13:33:04 +0300 |
commit | ec78df167efca7feba360b29700ef052eccf4b69 (patch) | |
tree | 1bcad85c0bc4696c0d87b45faefb9f00daef01cb /Makefile.PL | |
parent | 9565c4d075158f27b5bfd6eab500f0e3f6d8c9ed (diff) | |
download | posixruncapture-ec78df167efca7feba360b29700ef052eccf4b69.tar.gz posixruncapture-ec78df167efca7feba360b29700ef052eccf4b69.tar.bz2 |
Improve constructor calling convention; implement timeout and line monitoring
* Capture.xs: Rewrite constructor to optionally take named arguments.
* Makefile.PL: Remove 'subdirs-test_.*' rules.
* capture.h (capture): New structure. All capture_ functions operate
on it.
* capture.c (capture_new): Change signature. Set line monitoring features
if required.
(capture_DESTROY): Free line buffers and dereference callback references.
* lib/POSIX/Run/Capture.pm: Fix trivial error
(get_lines): New method.
Diffstat (limited to 'Makefile.PL')
-rw-r--r-- | Makefile.PL | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile.PL b/Makefile.PL index 25f93c4..004a192 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -39,3 +39,26 @@ sub pasthru { return $val . "\\\n O='\$(CCFLAGS)'"; } +sub test { + my $val = shift->SUPER::test(@_); + open(my $fd, '<', \$val); + my @ret; + my $ignore; + while (<$fd>) { + chomp; + if (/^subdirs-test_.*$/) { + $ignore = 1; + } elsif ($ignore) { + if (/^$/) { + $ignore = 0; + } elsif (/^\S/) { + $ignore = 0; + push @ret, $_; + } + } else { + push @ret, $_; + } + } + close $fd; + return join("\n", @ret); +} |