/
exit.t
73 lines (55 loc) · 1.33 KB
/
exit.t
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!perl
# Copyright (C) 2009-2010, Parrot Foundation.
# $Id$
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test tests => 7;
=head1 NAME
t/op/exit.t - Testing the exit pseudo-opcode
=head1 SYNOPSIS
% prove t/op/exit.t
=head1 DESCRIPTION
Test both success and failure exit status.
=cut
pir_exit_code_is( <<'CODE', 0, 'pir exit with success' );
.sub main
exit 0
.end
CODE
pir_exit_code_is( <<'CODE', 1, 'pir exit with failure' );
.sub main
exit 1
.end
CODE
pasm_exit_code_is( <<'CODE', 1, 'pasm exit with failure' );
exit 1
CODE
pasm_exit_code_is( <<'CODE', 0, 'pasm exit without failure' );
exit 0
CODE
# If you know of a better place to put these tests, please put them there
pir_exit_code_is( <<'CODE', 0, 'pir exits with success by default' );
.sub main
$S0 = "cheese"
.end
CODE
TODO: {
local $TODO = 'pasm exits with 1 by default';
pasm_exit_code_is( <<'CODE', 0, 'exit with success by default' );
set I0, 0
CODE
}
TODO: {
local $TODO = 'pbc exits with 1 by default';
# Should we be using this file?
my $pbc = File::Spec->catfile(qw/ t native_pbc integer_1.pbc /);
pbc_exit_code_is($pbc, 0, 'pbc exits with 0 by default');
}
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: