-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.pl
More file actions
61 lines (54 loc) · 1.26 KB
/
test.pl
File metadata and controls
61 lines (54 loc) · 1.26 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env perl
# HARNESS-CAT-LONG
# THIS IS A GENERATED YATH RUNNER TEST - amended
# This test file will run the test suite with yath
# it will fall back to prove if yath is unavailable
# and finally it will fall back to regular test if
# prove is unavailable
use strict;
use warnings;
use lib 'lib';
use Path::Tiny qw(cwd);
if (
eval {
require App::Yath;
import App::Yath::Util qw/find_yath/;
1;
}
)
{
# tests performed with yath
system(
$^X, find_yath(), '-D', 'test',
'--default-search' => './t',
'--default-search' => './xt',
@ARGV
);
my $exit = $?;
# This makes sure it works with prove.
print "1..1\n";
print "not " if $exit;
print "ok 1 - Passed tests when run by yath\n";
print STDERR "yath exited with $exit" if $exit;
exit( $exit ? 255 : 0 );
}
elsif (
eval {
require App::Prove;
import App::Prove;
1;
}
)
{
# tests performed with prove
my $prove_file = Path::Tiny->cwd . '/.prove';
if ( -e $prove_file ) {
system('prove');
}
else {
system('prove --norc -l --state=all,save t/*.t');
}
}
else {
1; # tests preformed normally
}