[Webkit-unassigned] [Bug 68511] [EFL] Script for running WebKit-EFL Unit Tests
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 22 01:01:16 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=68511
--- Comment #4 from Krzysztof <k.czech at samsung.com> 2011-09-22 01:01:14 PST ---
(In reply to comment #3)
> (From update of attachment 108124 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=108124&action=review
>
> Informal r- for the reasons below.
>
> > Tools/Scripts/run-efl-tests:52
> > +sub runTest
> > +{
> > + my $args = @_[0];
> > + my $pathToBinary = "Source/Programs/EUnitTests";
> > + my $utName = "";
> > + if (length($args) > 0) {
> > + $utName = " --gtest_filter=" . $args . ".*" . "\n";
> > + }
> > + exit system($pathToBinary . $utName);
>
> My Perl-fu is a bit rusty, but wouldn't the following be more readable and less prone to escaping problems?
>
> sub runTest {
> my ($testFilter) = @_;
> my $pathToTestUtility = 'Source/Programs/EUnitTests';
> my @testArgs = ($pathToTestUtility);
>
> push @testArgs, ('--gtest_filter', "${testFilter}.*\n") if $testFilter;
> return system(@testArgs);
> }
>
Your suggestion is good, I'm bit new to the perl so your Perl-fu is better than mine
> > Tools/Scripts/run-efl-tests:57
> > +sub usage
> > +{
> > + my $programName = basename($0);
>
> Even though this is fine, the common pattern in WebKitPerl is to declare subroutine parameters as such (notice the more descriptive name as well):
>
> sub printUsage
> {
> my ($programName) = @_;
> ...
> }
>
> > Tools/Scripts/run-efl-tests:64
> > + print STDERR $usageText;
>
> Why is this printed to STDERR?
Allows stream redirection. "Help" in this context informs the user, that something did wrong.
>
> > Tools/Scripts/run-efl-tests:65
> > + exit 1;
>
> Why does the program return 1 when successfully printing the help output?
Point at, this is a failure situation
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list