| 1 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 1 | ▶ | use 5.020; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use experimental qw( signatures ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 0 | ▶ | use true; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 5 | |||
| 6 | package Test2::Require::ProgramInPath 0.01 { | ||
| 7 | |||
| 8 | # ABSTRACT: Skip test unless a program exists in the PATH | ||
| 9 | |||
| 10 | |||
| 11 | use File::Which (); | ||
| 12 | use Carp qw( confess ); | ||
| 13 | use parent qw( Test2::Require ); | ||
| 14 | |||
| 15 | sub skip ( $, $program = undef ) { | ||
| 16 | confess "no program specified" unless defined $program; | ||
| 17 | return undef if File::Which::which $program; | ||
| 18 | return "This test only runs if $program is in the PATH"; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | __END__ | ||