File: pureperl.t

package info (click to toggle)
libref-util-perl 0.204-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 252 kB
  • sloc: perl: 610; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (2)
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
use strict;
use warnings;
use Test::More;

BEGIN {
    plan skip_all => "All tests already executed in PP mode"
        if !eval { require Ref::Util::XS };

    no warnings 'uninitialized';
    plan skip_all => "Already running pure-Perl tests"
        if $ENV{PERL_REF_UTIL_IMPLEMENTATION} eq 'PP';
}

use Config;
use IPC::Open2 qw(open2);
use File::Find qw(find);

local $ENV{PERL_REF_UTIL_IMPLEMENTATION} = 'PP';
local $ENV{PERL5LIB} = join $Config{path_sep}, @INC;

my $this_file = quotemeta __FILE__;

find({ no_chdir => 1, wanted => sub {
    return if !/\.t\z/;

    my @cmd = ($^X, $_);

    open2(my $out, my $in, @cmd);
    while (my $line = <$out>) {
        print "   $line";
    }

    wait;
    ok !$?, "Exit $? from: @cmd";
} }, 't');

done_testing();