[svn:parrot] r40007 - in branches/darwin2hints: config/init/hints t/steps/init/hints

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Sat Jul 11 23:52:41 UTC 2009


Author: jkeenan
Date: Sat Jul 11 23:52:40 2009
New Revision: 40007
URL: https://trac.parrot.org/parrot/changeset/40007

Log:
Add some tests for corner cases.

Modified:
   branches/darwin2hints/config/init/hints/darwin.pm
   branches/darwin2hints/t/steps/init/hints/darwin-01.t

Modified: branches/darwin2hints/config/init/hints/darwin.pm
==============================================================================
--- branches/darwin2hints/config/init/hints/darwin.pm	Sat Jul 11 23:28:09 2009	(r40006)
+++ branches/darwin2hints/config/init/hints/darwin.pm	Sat Jul 11 23:52:40 2009	(r40007)
@@ -250,11 +250,14 @@
                 }
             }
             print "Probe for $title successful\n" if $verbose;
+            return 1;
         }
         else {
             print "Probe for $title unsuccessful\n" if $verbose;
+            return 1;
         }
     }
+    return;
 }
 
 1;

Modified: branches/darwin2hints/t/steps/init/hints/darwin-01.t
==============================================================================
--- branches/darwin2hints/t/steps/init/hints/darwin-01.t	Sat Jul 11 23:28:09 2009	(r40006)
+++ branches/darwin2hints/t/steps/init/hints/darwin-01.t	Sat Jul 11 23:52:40 2009	(r40007)
@@ -225,6 +225,24 @@
         "_set_deployment_environment(): MACOSX_DEPLOYMENT_TARGET set as expected");
 }
     
+
+##### _probe_for_libraries() #####
+{
+    $conf->options->set( 'darwin_no_fink' => 1 );
+    $conf->options->set( 'verbose' => 0 );
+    my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
+    my $flagsref = {};
+    $flagsref->{ldflags} .= " -L$lib_dir";
+    $flagsref->{ccflags} .= " -pipe -fno-common -Wno-long-double ";
+    $flagsref->{linkflags} .= " -undefined dynamic_lookup";
+    my %state_before = map { $_ => $flagsref->{$_} } keys %{ $flagsref };
+    ok( ! defined ( init::hints::darwin::_probe_for_libraries(
+        $conf, $flagsref, 'fink')
+    ), "_probe_for_libraries() returned undef as expected" );
+    is_deeply( $flagsref, { %state_before },
+        "No change in flags, as expected" );
+}
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################


More information about the parrot-commits mailing list