aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/vm/process_death.pm
blob: 52039a1a1986939c52e074d2faf8d200bef508ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- perl -*-
use strict;
use warnings;
use tests::tests;

sub check_process_death {
    my ($proc_name) = @_;
    our ($test);
    my (@output) = read_text_file ("$test.output");

    common_checks ("run", @output);
    @output = get_core_output ("run", @output);
    fail "First line of output is not `($proc_name) begin' message.\n"
      if $output[0] ne "($proc_name) begin";
    fail "Output missing '$proc_name: exit(-1)' message.\n"
      if !grep ("$proc_name: exit(-1)" eq $_, @output);
    fail "Output contains '($proc_name) end' message.\n"
      if grep (/\($proc_name\) end/, @output);
    pass;
}

1;