File: 86-xs-exe.t

package info (click to toggle)
libpar-packer-perl 1.064-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,388 kB
  • sloc: perl: 12,774; ansic: 1,474; makefile: 30; sh: 5
file content (30 lines) | stat: -rw-r--r-- 770 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
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
require "./t/utils.pl";

plan tests => 6;

my $exe = pp_ok(-I => "t/data/blib/lib", -I => "t/data/blib/arch", -e => <<'...');
use XSFoo; 
XSFoo::hello();

use DynaLoader;
print qq[dl_shared_objects = @DynaLoader::dl_shared_objects\n];
print qq[dl_modules = @DynaLoader::dl_modules\n];
...

my ($out, $err) = run_ok($exe);
like($out, qr/greetings from XSFoo/, "output from XSFoo::hello matches");

diag($out);
$out =~ s:\\:/:g;
my ($shared_objects) = $out =~ /^dl_shared_objects = (.*)$/m;
ok($shared_objects, "dl_shared_objects found");
my ($modules) = $out =~ /^dl_modules = (.*)$/m;
ok($modules, "dl_modules found");
ok((grep { $_ eq "XSFoo" } split(" ", $modules, -1)),
   "dl_modules contains XSFoo DLL");