[svn:parrot] r41931 - in branches/auto_libjit: . config/auto src t/steps/auto
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Sun Oct 18 15:36:08 UTC 2009
Author: jkeenan
Date: Sun Oct 18 15:36:04 2009
New Revision: 41931
URL: https://trac.parrot.org/parrot/changeset/41931
Log:
Have SVN ignore src/frame_builder_libjit.c and src/frame_builder_libjit.h.
Delete one unused variable. Add tests for auto::libjit.
Modified:
branches/auto_libjit/MANIFEST.SKIP
branches/auto_libjit/config/auto/libjit.pm
branches/auto_libjit/src/ (props changed)
branches/auto_libjit/t/steps/auto/libjit-01.t
Modified: branches/auto_libjit/MANIFEST.SKIP
==============================================================================
--- branches/auto_libjit/MANIFEST.SKIP Sun Oct 18 14:56:49 2009 (r41930)
+++ branches/auto_libjit/MANIFEST.SKIP Sun Oct 18 15:36:04 2009 (r41931)
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Sep 27 09:00:39 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Oct 18 15:34:28 2009 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -653,6 +653,10 @@
^src/extend_vtable\.c/
^src/fingerprint\.c$
^src/fingerprint\.c/
+^src/frame_builder_libjit\.c$
+^src/frame_builder_libjit\.c/
+^src/frame_builder_libjit\.h$
+^src/frame_builder_libjit\.h/
^src/glut_callbacks\.c$
^src/glut_callbacks\.c/
^src/install_config\.c$
Modified: branches/auto_libjit/config/auto/libjit.pm
==============================================================================
--- branches/auto_libjit/config/auto/libjit.pm Sun Oct 18 14:56:49 2009 (r41930)
+++ branches/auto_libjit/config/auto/libjit.pm Sun Oct 18 15:36:04 2009 (r41931)
@@ -90,8 +90,7 @@
}
sub _evaluate_cc_run {
- my $self = shift;
- my ($test, $has_libjit, $verbose) = @_;
+ my ($self, $test, $has_libjit, $verbose) = @_;
if ($test =~ m/^USES INTERPRETER: \d+/ ) {
$has_libjit = 1;
print " (yes) " if $verbose;
Modified: branches/auto_libjit/t/steps/auto/libjit-01.t
==============================================================================
--- branches/auto_libjit/t/steps/auto/libjit-01.t Sun Oct 18 14:56:49 2009 (r41930)
+++ branches/auto_libjit/t/steps/auto/libjit-01.t Sun Oct 18 15:36:04 2009 (r41931)
@@ -6,38 +6,102 @@
use strict;
use warnings;
-use Test::More tests => 9;
-
-use lib 'lib';
-
+use Test::More tests => 28;
+use lib qw( lib t/configure/testlib );
use Parrot::Configure;
use Parrot::Configure::Options 'process_options';
use Parrot::Configure::Test qw(
test_step_thru_runstep
+ rerun_defaults_for_testing
test_step_constructor_and_description
);
+use IO::CaptureOutput qw( capture );
use_ok('config::init::defaults');
use_ok('config::auto::libjit');
########## _select_lib() ##########
-my ($args, $step_list_ref) = process_options(
- {
- argv => [],
- mode => 'configure',
- }
-);
+my ($args, $step_list_ref) = process_options( {
+ argv => [ q{--without-libjit} ],
+ mode => 'configure',
+} );
my $conf = Parrot::Configure->new;
+my $serialized = $conf->pcfreeze();
+
test_step_thru_runstep( $conf, 'init::defaults', $args );
my $pkg = 'auto::libjit';
+my ( $step, $ret );
$conf->add_steps($pkg);
$conf->options->set(%$args);
-my $stp = test_step_constructor_and_description($conf);
+$step = test_step_constructor_and_description($conf);
+$ret = $step->runstep($conf);
+ok( $ret, "runstep() returned true value" );
+is( $step->result(), 'no', "Result is 'no', as expected" );
+is( $conf->data->get( 'HAS_LIBJIT' ), 0,
+ "Got expected result with --without-libjit option" );
+$conf->cc_clean();
+
+$conf->replenish($serialized);
+
+($args, $step_list_ref) = process_options( {
+ argv => [ ],
+ mode => q{configure},
+} );
+rerun_defaults_for_testing($conf, $args );
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$ret = $step->runstep($conf);
+ok( $ret, "runstep() returned true value" );
+like( $step->result(), qr/yes|no/, "Result is either 'yes' or 'no'" );
+ok( defined( $conf->data->get( 'HAS_LIBJIT' ) ),
+ "'HAS_LIBJIT' has defined value" );
+$conf->cc_clean();
+
+########## _evaluate_cc_run ##########
+
+my ($test, $has_libjit, $verbose);
+
+$step->set_result( undef );
+
+$test = q{USES INTERPRETER: 33};
+$has_libjit = 0;
+$verbose = 0;
+$has_libjit = $step->_evaluate_cc_run($test, $has_libjit, $verbose);
+ok( $has_libjit, "_evaluate_cc_run() returned true value, as expected" );
+is( $step->result(), 'yes', "result is yes, as expected" );
+
+$step->set_result( undef );
+
+$test = q{foobar};
+$has_libjit = 0;
+$verbose = 0;
+$has_libjit = $step->_evaluate_cc_run($test, $has_libjit, $verbose);
+ok( ! $has_libjit, "_evaluate_cc_run() returned false value, as expected" );
+ok( ! defined($step->result()), "result is undefined, as expected" );
+
+$step->set_result( undef );
+
+$test = q{USES INTERPRETER: 33};
+$has_libjit = 0;
+$verbose = 1;
+{
+ my ($stdout, $stderr);
+ capture(
+ sub { $has_libjit =
+ $step->_evaluate_cc_run($test, $has_libjit, $verbose); },
+ \$stdout,
+ \$stderr,
+ );
+ ok( $has_libjit, "_evaluate_cc_run() returned true value, as expected" );
+ is( $step->result(), 'yes', "result is yes, as expected" );
+ like( $stdout, qr/\(yes\)/, "Got expected verbose output" );
+}
################### DOCUMENTATION ###################
More information about the parrot-commits
mailing list