Alien-PCRE2

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


    - Windows, Skip pcre-config Tests If sh Bourne Shell Not Found, Part 2

0.011000 2017-07-18

    - Windows, Skip pcre-config Tests If sh Bourne Shell Not Found

0.010000 2017-07-16

    - Require PCRE2 Minimum Version v10.30 During Build Time
    - Test Suite, Skip cflags Test On system Install Type

0.009000 2017-07-15

    - Test Suite, Upgrade To Test::Alien
    - Quality Assurance, Enable Debugging Output

0.008000 2017-07-13

    - Require Alien::Build v0.60 For Bug Fixes

t/02_pcre2_config.t  view on Meta::CPAN

    diag "\n\n", q{<<< DEBUG >>> in t/02_pcre2_config.t, have $version_split_0 = '}, $version_split_0, q{'}, "\n\n";
    cmp_ok($version_split_0, '>=', 10, 'Command `pcre2-config --version` returns major version 10 or newer');


    SKIP: {
        skip 'Major version greater than 10 does not require minor version check', 1 if ($version_split_0 != 10);
        my $version_split_1 = $version_split->[1] + 0;
        cmp_ok($version_split_1, '>=', 23, 'Command `pcre2-config --version` returns minor version 23 or newer');
    }

    # run `pcre2-config --cflags`, check for valid output
    my $cflags = [ split /\r?\n/, capture_merged { system $sh_path . q{ } . $pcre2_path . ' --cflags'; }];  # WINDOWS HACK: must explicitly give 'sh' or it won't run
    diag "\n\n", q{<<< DEBUG >>> in t/02_pcre2_config.t, have $cflags = }, Dumper($cflags), "\n\n";

    SKIP: {
        skip 'System install may not necessarily set cflags', 4 if (Alien::PCRE2->install_type() eq 'system');

        cmp_ok((scalar @{$cflags}), '==', 1, 'Command `pcre2-config --cflags` executes with 1 line of output');

        my $cflags_0 = $cflags->[0];
        diag "\n\n", q{<<< DEBUG >>> in t/02_pcre2_config.t, have $cflags_0 = '}, $cflags_0, q{'}, "\n\n";
        ok(defined $cflags_0, 'Command `pcre2-config --cflags` 1 line of output is defined');
        is((substr $cflags_0, 0, 2), '-I', 'Command `pcre2-config --cflags` 1 line of output starts correctly');
        if ($OSNAME eq 'MSWin32') {
            ok($cflags_0 =~ m/([\w\.\-\s\\\:]+)$/xms, 'Command `pcre2-config --cflags` 1 line of output is valid');  # match -IC:\dang_windows\paths\ -ID:\drive_letters\as.well
        }
        else {
            ok($cflags_0 =~ m/([\w\.\-\s\/]+)$/xms, 'Command `pcre2-config --cflags` 1 line of output is valid');  # match -I/some_path/to.somewhere/ -I/and/another
        }
    }
}
 
done_testing;

t/03_pcre2grep.t  view on Meta::CPAN


if( Alien::PCRE2->install_type('system') ) {
    skip_all 'pcre2grep might not be installed for system install';
} else {
    plan(10);
}

# load alien
alien_ok('Alien::PCRE2', 'Alien::PCRE2 loads successfully and conforms to Alien::Base specifications');

# test version flag
my $run_object = run_ok([ 'pcre2grep', '--version' ], 'Command `pcre2grep --version` runs');
diag "\n", q{<<< DEBUG >>> in t/03_pcre2grep.t, have $run_object->out() = }, Dumper($run_object->out()), "\n";
diag "\n", q{<<< DEBUG >>> in t/03_pcre2grep.t, have $run_object->err() = }, Dumper($run_object->err()), "\n";
$run_object->success('Command `pcre2grep --version` runs successfully');
is((substr $run_object->out(), 0, 18), 'pcre2grep version ', 'Command `pcre2grep --version` output starts correctly');
# DEV NOTE: can't use out_like() on the next line because it does not properly capture to $1, as used in the following split
ok($run_object->out() =~ m/([\d\.]+)(?:-(?:DEV|RC\d))?[\d\.\-\s]*$/xms, 'Command `pcre2grep --version` runs with valid output');

# test actual version numbers
my $version_split = [split /[.]/, $1];



( run in 0.316 second using v1.01-cache-2.11-cpan-94b05bcf43c )