[Webkit-unassigned] [Bug 68511] [EFL] Script for running WebKit-EFL Unit Tests
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Sep 21 10:53:57 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=68511
Leandro Pereira <leandro at profusion.mobi> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #108124|review?, commit-queue? |review-
Flag| |
--- Comment #3 from Leandro Pereira <leandro at profusion.mobi> 2011-09-21 10:53:56 PST ---
(From update of attachment 108124)
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);
}
> 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?
> Tools/Scripts/run-efl-tests:65
> + exit 1;
Why does the program return 1 when successfully printing the help output?
--
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