| 1 |
#!/usr/bin/env perl |
| 2 |
# HARNESS-NO-RUN |
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
use lib 'lib'; |
| 7 |
use App::Yath::Util qw/find_yath/; |
| 8 |
|
| 9 |
print "1..2\n"; |
| 10 |
|
| 11 |
$ENV{'YATH_SELF_TEST'} = 1; |
| 12 |
system($^X, find_yath(), '-D', 'test', '--qvf', '-r1', '--default-search' => './t', '--default-search' => './t2', @ARGV); |
| 13 |
my $exit1 = $?; |
| 14 |
|
| 15 |
$ENV{T2_NO_FORK} = 1; |
| 16 |
system($^X, find_yath(), '-D', 'test', '--qvf', '-r1', '--default-search' => './t', '--default-search' => './t2', @ARGV); |
| 17 |
my $exit2 = $?; |
| 18 |
|
| 19 |
print "not " if $exit1; |
| 20 |
print "ok 1 - Passed tests when run by yath (allow fork)\n"; |
| 21 |
print STDERR "yath exited with $exit1" if $exit1; |
| 22 |
|
| 23 |
print "not " if $exit2; |
| 24 |
print "ok 2 - Passed tests when run by yath (no fork)\n"; |
| 25 |
print STDERR "yath exited with $exit2" if $exit2; |
| 26 |
|
| 27 |
exit($exit1 || $exit2 ? 255 : 0); |