File: 90-exitcode.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 (21 lines) | stat: -rw-r--r-- 403 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
#!/usr/bin/perl

use strict;
use warnings;
use File::Basename;

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

my @scripts = ('exit(42);', 'END { exit(42); }', 'END { $? = 42; }');
plan tests => 2 * @scripts;

foreach my $script (@scripts) 
{
    my $exe = pp_ok( -e => $script);

    # obviously can't use run_ok() here
    run3([ $exe ], \undef);
    is($? >> 8, 42, qq[$exe exited with expected code]);
}