| 1 |
package App::Yath::Plugin::SelfTest; |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use Test2::Harness::TestFile; |
| 6 |
|
| 7 |
use IPC::Cmd qw/can_run/; |
| 8 |
use parent 'App::Yath::Plugin'; |
| 9 |
|
| 10 |
sub find_files { |
| 11 |
my ($plugin, $run, $search) = @_; |
| 12 |
|
| 13 |
return if ($search && !grep { m{^(./)?t2(/non_perl(/(.*)?)?)?} } @$search); |
| 14 |
|
| 15 |
my @out; |
| 16 |
|
| 17 |
if (can_run('/usr/bin/bash')) { |
| 18 |
push @out => Test2::Harness::TestFile->new(file => "t2/non_perl/test.sh"); |
| 19 |
} |
| 20 |
|
| 21 |
if (can_run('gcc')) { |
| 22 |
system('gcc', '-o' => 't2/non_perl/test.binary', 't2/non_perl/test.c') and die "Failed to compile t2/non_perl/test.c"; |
| 23 |
push @out => Test2::Harness::TestFile->new(file => "t2/non_perl/test.binary"); |
| 24 |
} |
| 25 |
|
| 26 |
return @out; |
| 27 |
} |
| 28 |
|
| 29 |
1; |