~ubuntu-branches/ubuntu/raring/parrot/raring-proposed

« back to all changes in this revision

Viewing changes to t/steps/auto/frames-01.t

  • Committer: Bazaar Package Importer
  • Author(s): Allison Randal
  • Date: 2011-07-30 18:45:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730184503-34d4mprtfx6pt5h3
Tags: 3.6.0-1
* New upstream release
* debian/watch:
  - Modified regular expression to capture numbered directory name
    (patch from Dominique Dumont).
* debian/rules:
  - Split build-arch and build-indep, resolving lintian warning.
  - Update path to pbc_disassemble for manpage generation (patch
    from Dominique Dumont).
* debian/patches:
  - Added patch 02_fix_perl_interpreter_path.patch, resolving
    lintian warnings.
* debian/control:
  - Added DM-Upload-Allowed field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! perl
2
 
# Copyright (C) 2009, Parrot Foundation.
3
 
# auto/frames-01.t
4
 
 
5
 
use strict;
6
 
use warnings;
7
 
use Test::More tests => 22;
8
 
use lib qw( lib t/configure/testlib );
9
 
use_ok('config::auto::frames');
10
 
use Parrot::Configure::Options qw( process_options );
11
 
use Parrot::Configure::Step::Test;
12
 
use Parrot::Configure::Test qw(
13
 
    test_step_constructor_and_description
14
 
);
15
 
 
16
 
 
17
 
my ($args, $step_list_ref) = process_options( {
18
 
    argv => [ ],
19
 
    mode => q{configure},
20
 
} );
21
 
 
22
 
my $conf = Parrot::Configure::Step::Test->new;
23
 
$conf->include_config_results( $args );
24
 
 
25
 
my $serialized = $conf->pcfreeze();
26
 
 
27
 
my $pkg = q{auto::frames};
28
 
$conf->add_steps($pkg);
29
 
$conf->options->set( %{$args} );
30
 
my $step = test_step_constructor_and_description($conf);
31
 
 
32
 
# To avoid a warning about an unitialized value, we will set nvsize to 8,
33
 
# cpuarch to i386 and osname to linux.
34
 
# This is normally done during earlier configuration steps.
35
 
$conf->data->set( nvsize => 8 );
36
 
$conf->data->set( cpuarch => 'i386' );
37
 
$conf->data->set( osname => 'linux' );
38
 
 
39
 
my $ret = $step->runstep($conf);
40
 
ok( $ret, "runstep() returned true value" );
41
 
ok( defined ( $step->result() ),
42
 
    "Got defined result" );
43
 
TODO: {
44
 
    local $TODO =
45
 
        'build frames temporarily disabled at pcc_reapply merge: TT #1132';
46
 
    is( $step->result(), 'yes', "Result is 'yes', as expected" );
47
 
}
48
 
$conf->cc_clean();
49
 
$step->set_result( undef );
50
 
 
51
 
$conf->replenish($serialized);
52
 
 
53
 
###### _call_frames_buildable() #####
54
 
 
55
 
my $can_build_call_frames;
56
 
 
57
 
$conf->options->set( buildframes => 1 );
58
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
59
 
ok( $can_build_call_frames,
60
 
    "_call_frames_buildable() returned true value, as expected" );
61
 
 
62
 
$conf->options->set( buildframes => 0 );
63
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
64
 
ok( ! $can_build_call_frames,
65
 
    "_call_frames_buildable() returned false value, as expected" );
66
 
 
67
 
$conf->options->set( buildframes => undef );
68
 
$conf->data->set( osname =>  'linux' );
69
 
$conf->data->set( cpuarch =>  'i386' );
70
 
$conf->data->set( nvsize =>  8 );
71
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
72
 
TODO: {
73
 
    local $TODO =
74
 
        'build frames temporarily disabled at pcc_reapply merge: TT #1132';
75
 
    ok( $can_build_call_frames,
76
 
        "_call_frames_buildable() returned true value, as expected (i386/non darwin/8)"
77
 
    );
78
 
}
79
 
 
80
 
$conf->data->set( osname =>  'darwin' );
81
 
$conf->data->set( cpuarch =>  'i386' );
82
 
$conf->data->set( nvsize =>  8 );
83
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
84
 
ok( ! $can_build_call_frames,
85
 
    "_call_frames_buildable() returned false value, as expected (i386/darwin/8)" );
86
 
 
87
 
$conf->data->set( osname =>  'linux' );
88
 
$conf->data->set( cpuarch =>  'ppc' );
89
 
$conf->data->set( nvsize =>  8 );
90
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
91
 
ok( ! $can_build_call_frames,
92
 
    "_call_frames_buildable() returned false value, as expected (ppc/linux/8)" );
93
 
 
94
 
$conf->data->set( osname =>  'linux' );
95
 
$conf->data->set( cpuarch =>  'i386' );
96
 
$conf->data->set( nvsize =>  4 );
97
 
$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
98
 
ok( ! $can_build_call_frames,
99
 
    "_call_frames_buildable() returned false value, as expected (i386/linux/4)" );
100
 
 
101
 
##### _handle_call_frames_buildable() #####
102
 
 
103
 
$conf->data->set( nvsize => 8 );
104
 
$conf->data->set( cpuarch => 'i386' );
105
 
$conf->data->set( osname => 'linux' );
106
 
 
107
 
my $rv;
108
 
 
109
 
$can_build_call_frames = 0;
110
 
$rv = $step->_handle_can_build_call_frames( $conf, $can_build_call_frames );
111
 
ok( $rv, "_handle_can_build_call_frames() returned true value" );
112
 
ok( ! $conf->data->get( 'cc_build_call_frames'),
113
 
    "cc_build_call_frames not set to true, as expected" );
114
 
ok( ! defined( $conf->data->get( 'has_exec_protect' ) ),
115
 
    "has_exec_protect undefined, as expected" );
116
 
is( $step->result(), 'no', "Result is 'no', as expected" );
117
 
 
118
 
$conf->data->set( 'cc_build_call_frames' => undef );
119
 
$conf->data->set( 'has_exec_protect' => undef );
120
 
 
121
 
$can_build_call_frames = 1;
122
 
my $realos = $conf->data->get( 'osname' );
123
 
$conf->data->set( 'osname' => 'foobar' );
124
 
$rv = $step->_handle_can_build_call_frames( $conf, $can_build_call_frames );
125
 
ok( $rv, "_handle_can_build_call_frames() returned true value" );
126
 
is( $conf->data->get( 'cc_build_call_frames'), '-DCAN_BUILD_CALL_FRAMES',
127
 
    "cc_build_call_frames set to expected value" );
128
 
is( $conf->data->get( 'has_exec_protect' ), 0,
129
 
    "has_exec_protect is 0, as expected" );
130
 
is( $step->result(), 'yes', "Result is 'yes', as expected" );
131
 
 
132
 
$conf->data->set( 'cc_build_call_frames' => undef );
133
 
$conf->data->set( 'has_exec_protect' => undef );
134
 
$conf->data->set( 'osname' => $realos );
135
 
 
136
 
pass("Completed all tests in $0");
137
 
 
138
 
################### DOCUMENTATION ###################
139
 
 
140
 
=head1 NAME
141
 
 
142
 
auto/frames-01.t - test auto::frames
143
 
 
144
 
=head1 SYNOPSIS
145
 
 
146
 
    % prove t/steps/auto/frames-01.t
147
 
 
148
 
=head1 DESCRIPTION
149
 
 
150
 
The files in this directory test functionality used by F<Configure.pl>.
151
 
 
152
 
The tests in this file test auto::frames.
153
 
 
154
 
=head1 AUTHOR
155
 
 
156
 
Daniel Arbelo Arrocha
157
 
 
158
 
=head1 SEE ALSO
159
 
 
160
 
config::auto::frames, F<Configure.pl>.
161
 
 
162
 
=cut
163
 
 
164
 
# Local Variables:
165
 
#   mode: cperl
166
 
#   cperl-indent-level: 4
167
 
#   fill-column: 100
168
 
# End:
169
 
# vim: expandtab shiftwidth=4: