File: 03_signal.t

package info (click to toggle)
libipc-system-simple-perl 1.30-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: perl: 908; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (6)
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
32
33
34
#!/usr/bin/perl -w
use strict;
use Test::More;
use Config;

use constant SIGKILL => 9;

if ($^O eq "MSWin32") {
	plan skip_all => "Signals not implemented on Win32";
} else {
	plan tests => 3;
}

# We want to invoke our sub-commands using Perl.

my $perl_path = $Config{perlpath};

if ($^O ne 'VMS') {
        $perl_path .= $Config{_exe}
                unless $perl_path =~ m/$Config{_exe}$/i;
}

use_ok("IPC::System::Simple","run");

chdir("t");

run([1],$perl_path,"signaler.pl",0);
ok(1);

eval {
	run([1],$perl_path,"signaler.pl",SIGKILL);
};

like($@, qr/died to signal/);