-
Notifications
You must be signed in to change notification settings - Fork 138
/
02-get_test_prog_args.t
97 lines (76 loc) · 2.08 KB
/
02-get_test_prog_args.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#! perl
# Copyright (C) 2007, Parrot Foundation.
# 02-get_test_prog_args.t
use strict;
use warnings;
use lib qw( lib );
use Test::More;
eval {
use Parrot::Config qw( %PConfig );
};
plan( skip_all => 't/harness only runs once configuration has completed' )
if $@;
plan( tests => 12 );
use Carp;
use Parrot::Harness::Options qw( get_test_prog_args );
my ($args, $optsref);
my ($gc_debug, $run_exec);
$optsref = {
'd' => 1,
'g' => 1,
'D' => 40,
};
($gc_debug, $run_exec) = (0,0);
$args = get_test_prog_args($optsref, $gc_debug, $run_exec);
like($args, qr/-d/, "Got expected option");
like($args, qr/-D40/, "Got expected option");
$optsref = {
'd' => 1,
'g' => 1,
'D' => 40,
'O' => 2,
};
($gc_debug, $run_exec) = (0,0);
$args = get_test_prog_args($optsref, $gc_debug, $run_exec);
like($args, qr/-d/, "Got expected option");
like($args, qr/-D40/, "Got expected option");
like($args, qr/-O2/, "Got expected option");
$optsref = {
'd' => 1,
'g' => 1,
'D' => 40,
};
($gc_debug, $run_exec) = (1,0);
$args = get_test_prog_args($optsref, $gc_debug, $run_exec);
like($args, qr/-d/, "Got expected option");
like($args, qr/-D40/, "Got expected option");
like($args, qr/\s--gc-debug/, "Got expected option");
$optsref = {
'd' => 1,
'g' => 1,
'D' => 40,
};
($gc_debug, $run_exec) = (0,1);
$args = get_test_prog_args($optsref, $gc_debug, $run_exec);
like($args, qr/-d/, "Got expected option");
like($args, qr/-D40/, "Got expected option");
like($args, qr/\s--run-exec/, "Got expected option");
pass("Completed all tests in $0");
################### DOCUMENTATION ###################
=head1 NAME
02-get_test_prog_args.t - test Parrot::Harness::Options
=head1 SYNOPSIS
% prove t/pharness/02-get_test_prog_args.t
=head1 DESCRIPTION
This file holds tests for Parrot::Harness::Options::get_test_prog_args().
=head1 AUTHOR
James E Keenan
=head1 SEE ALSO
Parrot::Harness::Options, F<t/harness>.
=cut
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: