WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
104298
change --no-launch-safari to --no-show-results in scripts
https://bugs.webkit.org/show_bug.cgi?id=104298
Summary
change --no-launch-safari to --no-show-results in scripts
Dirk Pranke
Reported
2012-12-06 14:04:05 PST
change --no-launch-safari to --no-show-results in scripts
Attachments
Patch
(7.27 KB, patch)
2012-12-06 14:06 PST
,
Dirk Pranke
no flags
Details
Formatted Diff
Diff
rework to just pass --no-show-results to ORWT
(6.32 KB, patch)
2012-12-10 15:17 PST
,
Dirk Pranke
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Dirk Pranke
Comment 1
2012-12-06 14:06:30 PST
Created
attachment 178078
[details]
Patch
Eric Seidel (no email)
Comment 2
2012-12-06 15:25:35 PST
Comment on
attachment 178078
[details]
Patch Looks reasonable.
Daniel Bates
Comment 3
2012-12-07 00:00:26 PST
Comment on
attachment 178078
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=178078&action=review
> Tools/ChangeLog:13 > + for ORWT (I didn't modify ORWT itself because making the arg parsing > + work turned out to be pretty awkward).
(*) Can you elaborate on the awkwardness?
> Tools/Scripts/run-webkit-tests:102 > + if (grep(/--no-show-results/, @ARGV)) { > + push(@ARGV, "--no-launch-safari"); > + @ARGV = grep { $_ ne "--no-show-results" } @ARGV; > + }
Assuming we take the approach of substituting --[no-]launch-safari for --[no-]show-results (see my question (*) above), I suggest that we take advantage of the convenience function webkitdirs::checkForArgumentAndRemoveFromARGV() instead of implementing similar functionality. As its name implies, webkitdirs::checkForArgumentAndRemoveFromARGV() checks for the presence of the specified command line argument and removes it if present. The function returns true if the argument was in the list of command line arguments; otherwise, it returns false. Simplifying this code using webkitdirs::checkForArgumentAndRemoveFromARGV(), we have: push(@ARGV, "--no-launch-safari") if checkForArgumentAndRemoveFromARGV("--no-show-results");
> Tools/Scripts/run-webkit-tests:106 > + if (grep(/--show-results/, @ARGV)) { > + push(@ARGV, "--launch-safari"); > + @ARGV = grep { $_ ne "--show-results" } @ARGV; > + }
Assuming we take the approach of substituting --[no-]-launch-safari for --[no-]show-results (see my question (*) above), we can similarly write this using webkitdirs::checkForArgumentAndRemoveFromARGV() as: push(@ARGV, "--launch-safari") if checkForArgumentAndRemoveFromARGV("--show-results");
Dirk Pranke
Comment 4
2012-12-07 09:01:21 PST
(In reply to
comment #3
)
> (From update of
attachment 178078
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=178078&action=review
> > > Tools/ChangeLog:13 > > + for ORWT (I didn't modify ORWT itself because making the arg parsing > > + work turned out to be pretty awkward). > > (*) Can you elaborate on the awkwardness? >
I wasn't sure if you meant here or in the ChangeLog, but when I initially looked at the perl arg-parsing code I didn't see a way to easily make one option an alias for another, and since we displayed the default values for --launch-safari as well it looked like it was going to take a bunch of searching-and-replacing in multiple locations to make things work. However, I just re-checked the Getopt::Long perldoc and it looks like you can define a custom subroutine to make the args aliases, so I'll try that and if it works push all of this down into old-run-webkit-tests so we don't need to do the substitution any more. Failing all that, your suggestion below sounds fine.
> > Tools/Scripts/run-webkit-tests:102 > > + if (grep(/--no-show-results/, @ARGV)) { > > + push(@ARGV, "--no-launch-safari"); > > + @ARGV = grep { $_ ne "--no-show-results" } @ARGV; > > + } > > Assuming we take the approach of substituting --[no-]launch-safari for --[no-]show-results (see my question (*) above), I suggest that we take advantage of the convenience function webkitdirs::checkForArgumentAndRemoveFromARGV() instead of implementing similar functionality. As its name implies, webkitdirs::checkForArgumentAndRemoveFromARGV() checks for the presence of the specified command line argument and removes it if present. The function returns true if the argument was in the list of command line arguments; otherwise, it returns false. Simplifying this code using webkitdirs::checkForArgumentAndRemoveFromARGV(), we have: > > push(@ARGV, "--no-launch-safari") if checkForArgumentAndRemoveFromARGV("--no-show-results"); > > > Tools/Scripts/run-webkit-tests:106 > > + if (grep(/--show-results/, @ARGV)) { > > + push(@ARGV, "--launch-safari"); > > + @ARGV = grep { $_ ne "--show-results" } @ARGV; > > + } > > Assuming we take the approach of substituting --[no-]-launch-safari for --[no-]show-results (see my question (*) above), we can similarly write this using webkitdirs::checkForArgumentAndRemoveFromARGV() as: > > push(@ARGV, "--launch-safari") if checkForArgumentAndRemoveFromARGV("--show-results");
Dirk Pranke
Comment 5
2012-12-10 15:17:43 PST
Created
attachment 178643
[details]
rework to just pass --no-show-results to ORWT
Dirk Pranke
Comment 6
2012-12-10 15:19:43 PST
new patch, much simpler ...
Eric Seidel (no email)
Comment 7
2012-12-10 15:28:37 PST
Comment on
attachment 178643
[details]
rework to just pass --no-show-results to ORWT OK.
WebKit Review Bot
Comment 8
2012-12-10 18:01:25 PST
Comment on
attachment 178643
[details]
rework to just pass --no-show-results to ORWT Clearing flags on attachment: 178643 Committed
r137237
: <
http://trac.webkit.org/changeset/137237
>
WebKit Review Bot
Comment 9
2012-12-10 18:01:30 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug