fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / t / steps / auto / socklen_t-01.t
blob1cbeeded63b10180fc2cf5d90ff3764dc1e129cc
1 #! perl
2 # Copyright (C) 2007, Parrot Foundation.
3 # $Id$
4 # auto/socklen_t-01.t
6 use strict;
7 use warnings;
8 use Test::More tests => 16;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::auto::socklen_t');
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Step::Test;
14 use Parrot::Configure::Test qw(
15     test_step_constructor_and_description
17 use IO::CaptureOutput qw| capture |;
19 ########### regular ###########
21 my ($args, $step_list_ref) = process_options(
22     {
23         argv => [ ],
24         mode => q{configure},
25     }
28 my $conf = Parrot::Configure::Step::Test->new;
29 $conf->include_config_results( $args );
31 my $pkg = q{auto::socklen_t};
33 $conf->add_steps($pkg);
35 my $serialized = $conf->pcfreeze();
37 $conf->options->set( %{$args} );
38 my $step = test_step_constructor_and_description($conf);
39 my $ret = $step->runstep($conf);
40 ok( $ret, "runstep() returned true value" );
41 ok(defined($step->result()), "A result has been defiined");
43 $conf->replenish($serialized);
45 ##### _evaluate_socklen_t() #####
47 ($args, $step_list_ref) = process_options(
48     {
49         argv => [ ],
50         mode => q{configure},
51     }
53 $conf->options->set( %{$args} );
54 $step = test_step_constructor_and_description($conf);
56 my $d_socklen_t;
58 $d_socklen_t = q{alpha};
59 ok($step->_evaluate_socklen_t($conf, $d_socklen_t),
60     "_evaluate_socklen_t() completed satisfactorily");
61 is($step->result(), q{yes}, "Got expected result");
62 is($conf->data->get('has_socklen_t'), 1,
63     "has_socklen_t set as expected");
65 $d_socklen_t = undef;
66 ok($step->_evaluate_socklen_t($conf, $d_socklen_t),
67     "_evaluate_socklen_t() completed satisfactorily");
68 is($step->result(), q{no}, "Got expected result");
69 is($conf->data->get('has_socklen_t'), 0,
70     "has_socklen_t set as expected");
72 pass("Completed all tests in $0");
74 ################### DOCUMENTATION ###################
76 =head1 NAME
78 auto/socklen_t-01.t - test auto::socklen_t
80 =head1 SYNOPSIS
82     % prove t/steps/auto/socklen_t-01.t
84 =head1 DESCRIPTION
86 The files in this directory test functionality used by F<Configure.pl>.
88 The tests in this file test auto::socklen_t.
90 =head1 AUTHOR
92 James E Keenan
94 =head1 SEE ALSO
96 config::auto::socklen_t, F<Configure.pl>.
98 =cut
100 # Local Variables:
101 #   mode: cperl
102 #   cperl-indent-level: 4
103 #   fill-column: 100
104 # End:
105 # vim: expandtab shiftwidth=4: