File: test.pl

package info (click to toggle)
libtest2-harness-perl 1.000161-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,904 kB
  • sloc: perl: 17,026; makefile: 10; ansic: 6; sh: 4
file content (27 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env perl
# HARNESS-NO-RUN
use strict;
use warnings;

use lib 'lib';
use App::Yath::Util qw/find_yath/;

print "1..2\n";

$ENV{'YATH_SELF_TEST'} = 1;
system($^X, find_yath(), '-D', 'test', '--qvf', '-r1', '--default-search' => './t', '--default-search' => './t2', @ARGV);
my $exit1 = $?;

$ENV{T2_NO_FORK} = 1;
system($^X, find_yath(), '-D', 'test', '--qvf', '-r1', '--default-search' => './t', '--default-search' => './t2', @ARGV);
my $exit2 = $?;

print "not " if $exit1;
print "ok 1 - Passed tests when run by yath (allow fork)\n";
print STDERR "yath exited with $exit1" if $exit1;

print "not " if $exit2;
print "ok 2 - Passed tests when run by yath (no fork)\n";
print STDERR "yath exited with $exit2" if $exit2;

exit($exit1 || $exit2 ? 255 : 0);