ASNMTAP

 view release on metacpan or  search on metacpan

lib/ASNMTAP/Asnmtap/Plugins/NPTest.pm  view on Meta::CPAN

	$envvar = $param;
	$new_style = 1;
  } else {
	( $param, $envvar, $default, $brief, $scoped ) = @_;
	$new_style = 0;
  }

  # Apply default values for optional arguments
  $scoped = ( defined( $scoped ) && $scoped );

  my $testharness = basename( (caller(0))[1], ".t" ); # used for scoping

  if ( defined( $envvar ) &&  exists( $ENV{$envvar} ) && $ENV{$envvar} )
  {
    return $ENV{$envvar};
  }

  my $cachedValue = SearchCache( $param, $testharness );
  if ( defined( $cachedValue ) )
  {
    # This save required to convert to new style because the key required is

lib/ASNMTAP/Asnmtap/Plugins/NPTest.pm  view on Meta::CPAN

	my $output = `$command`;
	$object->return_code($? >> 8);
	$_ = $? & 127;
	if ($_) {
		die "Got signal $_ for command $command";
	}
	chomp $output;
	$object->output($output);

	if ($ENV{'NPTEST_DEBUG'}) {
		my ($pkg, $file, $line) = caller(0);
		print "testCmd: Called from line $line in $file", $/;
		print "Testing: $command", $/;
		print "Output:  ", $object->output, $/;
		print "Return code: ", $object->return_code, $/;
	}

	return $object;
}

1;



( run in 0.229 second using v1.01-cache-2.11-cpan-b61123c0432 )