Algorithm-EventsPerSecond

 view release on metacpan or  search on metacpan

t/iqbi-damiq.t  view on Meta::CPAN

my $script = 'src_bin/iqbi-damiq';
plan skip_all => "$script not found (not running from the dist root?)"
	unless -f $script;

alarm 120;    # watchdog: a hung daemon must fail the test, not the harness

# blib for an installed-style run, lib as the fallback; missing include
# dirs are harmless
my @perl = ( $^X, '-Iblib/lib', '-Iblib/arch', '-Ilib' );

# run a command, returning its exit code and combined stdout/stderr
sub run_capture {
	my (@cmd) = @_;
	my $pid   = open my $fh, '-|';
	die "fork failed: $!" unless defined $pid;
	if ( !$pid ) {
		open STDERR, '>&', \*STDOUT or die "cannot dup STDERR: $!";
		exec @cmd or POSIX::_exit(127);
	}
	my $out = do { local $/; <$fh> };
	close $fh;



( run in 0.763 second using v1.01-cache-2.11-cpan-f52f0507bed )