File: 30-current_exec.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-- 735 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
#!/usr/bin/perl

use strict;
use warnings;
use Config;
use File::Spec::Functions;
use File::Path;
use File::Basename;
use FindBin;

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

plan skip_all => "Fails if run in a path that contains spaces" 
    if $FindBin::Bin =~ / /;
plan tests => 5;

my $exe = pp_ok( catfile(qw(t test-proc)) );

$ENV{PAR_GLOBAL_TMPDIR} = $ENV{PAR_TMPDIR};     # set by pp_ok

my ($out1) = run_ok( $exe );
ok( $out1 =~ /PAR_TEMP = \Q$ENV{PAR_TMPDIR}\E/, "Respected PAR_GLOBAL_TMPDIR" );

my( $file, $path ) = fileparse( $exe );
my ($out2) = do { 
    local $ENV{PATH} = join($Config{path_sep} || ':', $path, File::Spec->path());
    run_ok($file);
};

is( $out1, $out2, "Found the same file via PATH and full path" );