[svn:parrot] r37080 - trunk/lib/Parrot/Harness

coke at svn.parrot.org coke at svn.parrot.org
Mon Mar 2 16:11:27 UTC 2009


Author: coke
Date: Mon Mar  2 16:11:27 2009
New Revision: 37080
URL: https://trac.parrot.org/parrot/changeset/37080

Log:
Properly map t/harness options to parrot options. (e.g., -b => --runcore=bounds)
Tracks deprecation notice in RT #46503

Modified:
   trunk/lib/Parrot/Harness/Options.pm

Modified: trunk/lib/Parrot/Harness/Options.pm
==============================================================================
--- trunk/lib/Parrot/Harness/Options.pm	Mon Mar  2 16:01:26 2009	(r37079)
+++ trunk/lib/Parrot/Harness/Options.pm	Mon Mar  2 16:11:27 2009	(r37080)
@@ -78,9 +78,15 @@
     return $args;
 }
 
+# Given a hashref of options, convert to a hash; convert
+# some keys that used to map directly to parrot options. These keys
+# are not expected to have any values, so we cheat and push a parrot
+# commandline line option key/value into the key, and ignore the value.
+
 sub remap_runcore_opts
 {
     my ($opts_ref) = @_;
+
     my %remap      = (
         'j' => '-runcore=jit',
         'g' => '-runcore=cgoto',
@@ -90,8 +96,15 @@
         'f' => '-runcore=fast',
     );
 
-    return map { $_ => ( exists $remap{$_} ? $remap{$_} : $opts_ref->{$_} ) }
-        keys %{ $opts_ref };
+    my %mapped;
+    foreach my $opt (keys %$opts_ref) {
+        if (exists $remap{$opt}) {
+            $mapped{$remap{$opt}} = undef;
+        } else {
+            $mapped{$opt} = $opts_ref->{$opt};
+        }
+    }
+    return %mapped;
 }
 
 sub Usage {


More information about the parrot-commits mailing list