File: 85-ldlibpthname.t

package info (click to toggle)
libpar-packer-perl 1.063-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,380 kB
  • sloc: perl: 12,859; ansic: 1,486; makefile: 30; sh: 5
file content (31 lines) | stat: -rw-r--r-- 756 bytes parent folder | download
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
#!/usr/bin/perl -w

use strict;
use Config;
use Data::Dumper;

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

my $ldlibpthname = $^O eq 'MSWin32' ? "PATH" : $Config{ldlibpthname};

plan skip_all => "\$Config{ldlibpthname} is not available for your OS ($^O)" unless $ldlibpthname;
plan tests => 3;

my $exe = pp_ok(-e => <<"...");
    use Data::Dumper; 
    my \$data = { 
        par_temp => \$ENV{PAR_TEMP}, 
        ldlibpth => \$ENV{$ldlibpthname},
    };
    print Data::Dumper->new([\$data], ['data'])->Indent(1)->Useqq(1)->Dump();
...

my ($out) = run_ok($exe);
our $data;
eval $out;
ok($data->{ldlibpth} =~ /^\Q$data->{par_temp}\E($|\Q$Config{path_sep}\E)/,
    "PAR_TEMP is first item in $ldlibpthname as seen by packed executable")
    or diag($out);