RESOLVED DUPLICATE of bug 87251 68511
[EFL] Script for running WebKit-EFL Unit Tests
https://bugs.webkit.org/show_bug.cgi?id=68511
Summary [EFL] Script for running WebKit-EFL Unit Tests
Krzysztof Czech
Reported Wednesday, September 21, 2011 9:52:56 AM UTC
Support for running unit tests automatically.
Attachments
Patch (2.52 KB, patch)
2011-09-21 01:54 PDT, Krzysztof Czech
leandro: review-
Patch (2.52 KB, patch)
2011-09-26 07:49 PDT, Krzysztof Czech
no flags
Krzysztof Czech
Comment 1 Wednesday, September 21, 2011 9:54:30 AM UTC
Gyuyoung Kim
Comment 2 Wednesday, September 21, 2011 10:01:34 AM UTC
I think it is better to notify this contribution to webkit-dev mailing list first.
Leandro Pereira
Comment 3 Wednesday, September 21, 2011 6:53:56 PM UTC
Comment on attachment 108124 [details] Patch 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?
Krzysztof Czech
Comment 4 Thursday, September 22, 2011 9:01:14 AM UTC
(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
Krzysztof Czech
Comment 5 Monday, September 26, 2011 3:49:00 PM UTC
Leandro Pereira
Comment 6 Wednesday, October 19, 2011 5:31:49 PM UTC
Comment on attachment 108666 [details] Patch LGTM.
Raphael Kubo da Costa (:rakuco)
Comment 7 Monday, January 2, 2012 1:20:24 AM UTC
Coming to think of it again, I wonder if this script is really needed. Wouldn't using CMake's infrastructure for tests be enough (ie. running `make test' then runs the unit tests)?
Krzysztof Czech
Comment 8 Monday, January 2, 2012 11:19:19 AM UTC
I also thought about it. On the other hand, there are already available similar scripts for other ports: run-gtk-tests, run-chromium-webkit-unit-tests, run-api-tests. I'am not sure if this is some kind of convention of adding this kind of scripts. Apart from this we could also use CMake infrastructure.
Gyuyoung Kim
Comment 9 Tuesday, January 3, 2012 4:29:28 AM UTC
If there is a script for running EFL test, I'm please with it. But, it looks this patch can't be landed until other patches are landed. In addition, I think you need to notify this patch to webkit-dev. I think you have to get agreement from webkit community or reviewers.
Thiago Marcos P. Santos
Comment 10 Thursday, June 28, 2012 2:47:50 PM UTC
I'm not sure if this makes sense anymore. I think it can be done by using CTest and a build target. We don't have a global runner anymore. See bug 87251.
Thiago Marcos P. Santos
Comment 11 Monday, July 2, 2012 7:28:52 PM UTC
(In reply to comment #10) > I'm not sure if this makes sense anymore. I think it can be done by using CTest and a build target. We don't have a global runner anymore. See bug 87251. Should we close this bug?
Thiago Marcos P. Santos
Comment 12 Tuesday, July 3, 2012 5:21:57 PM UTC
*** This bug has been marked as a duplicate of bug 87251 ***
Raphael Kubo da Costa (:rakuco)
Comment 13 Wednesday, July 4, 2012 5:09:30 AM UTC
Comment on attachment 108666 [details] Patch Clearing r? flag from the patch.
Note You need to log in before you can comment on or make changes to this bug.