Re: Fixing make lcov with TESTS variable

From: Date: Tue, 08 Jun 2010 08:49:44 +0000
Subject: Re: Fixing make lcov with TESTS variable
References: 1 2 3 4 5  Groups: php.internals php.qa 
Request: Send a blank email to internals+get-48682@lists.php.net to get a copy of this message
2010/6/8 Nuno Lopes <nlopess@php.net>:
> Yep, sounds like a good idea! Feel free to commit that.

Can someone grant me the karma to fix it? Account: patrickallaert
Patch being committed in attachment.

> Nuno
>
> P.S.: I think at some point there was some distinction between 'test' and
> 'lcov-test', but I cannot remember what exactly. Anyway this is the way to
> go.
>
> ----- Original Message ----- 2010/6/6 Nuno Lopes <nlopess@php.net>:
>>
>> Hi,
>>
>> I haven't been much active lately, but I will still try to reply :)
>> This change doesn't look right to me. The directory tests is hardcoded
>> since
>> that code path is targeted for running the tests of PECL extensions, and
>> not
>> for the core extensions. That said, the 'lcov-test:' part is just a rip
>> from
>> 'test:'. However, it seems to be a bit outdated. Maybe you can try to port
>> the new 'test:' rule from Makefile.global and check if problems go away.
>
> I think it is even better to reuse 'test:' so that we don't have to
> maintain it, unless a special treatment other than removing some files
> is needed:
> Index: Makefile.gcov
> ===================================================================
> --- Makefile.gcov       (revision 300201)
> +++ Makefile.gcov       (working copy)
> @@ -5,24 +5,7 @@
>
> lcov: lcov-html
>
> -lcov-test: all
> -       @echo "Running test suite"
> -       @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs
> rm -f
> -       -@if test ! -z "$(PHP_EXECUTABLE)" && test -x
> "$(PHP_EXECUTABLE)"; then \
> -               NO_INTERACTION=1 \
> -               TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
> -               TEST_PHP_SRCDIR=$(top_srcdir) \
> -               CC="$(CC)" \
> -                       $(PHP_EXECUTABLE) -d 'open_basedir=' -d
> 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php
> -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo
> extension=$$dlname)` tests/; \
> -       elif test ! -z "$(SAPI_CLI_PATH)" && test -x
> "$(SAPI_CLI_PATH)"; then \
> -               NO_INTERACTION=1 \
> -               TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
> -               TEST_PHP_SRCDIR=$(top_srcdir) \
> -               CC="$(CC)" \
> -                       $(top_builddir)/$(SAPI_CLI_PATH) -d
> 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'
> $(top_srcdir)/run-tests.php $(TESTS); \
> -       else \
> -               echo "ERROR: Cannot run tests without CLI sapi."; \
> -       fi
> +lcov-test: lcov-clean-data test
>
> php_lcov.info: lcov-test
>       @echo "Generating data for $@"
> @@ -77,3 +60,5 @@
>       rm -rf lcov_data/
>       rm -rf lcov_html/
>
> +lcov-clean-data:
> +       @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
>
> Regards,
> Patrick
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php


Index: trunk/Makefile.gcov =================================================================== --- trunk/Makefile.gcov (revision 300267) +++ trunk/Makefile.gcov (working copy) @@ -5,24 +5,7 @@ lcov: lcov-html -lcov-test: all - @echo "Running test suite" - @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f - -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(PHP_EXECUTABLE) -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \ - elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \ - else \ - echo "ERROR: Cannot run tests without CLI sapi."; \ - fi +lcov-test: lcov-clean-data test php_lcov.info: lcov-test @echo "Generating data for $@" @@ -77,3 +60,5 @@ rm -rf lcov_data/ rm -rf lcov_html/ +lcov-clean-data: + @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f Index: branches/PHP_5_2/NEWS =================================================================== --- branches/PHP_5_2/NEWS (revision 300267) +++ branches/PHP_5_2/NEWS (working copy) @@ -18,6 +18,7 @@ - Fixed a possible arbitrary memory access inside sqlite extension. Reported by Mateusz Kocielski. (Ilia) +- Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick) - Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with - Fixed bug #51905 (ReflectionParameter fails if default value is an array with an access to self::). (Felipe) Index: branches/PHP_5_2/Makefile.gcov =================================================================== --- branches/PHP_5_2/Makefile.gcov (revision 300267) +++ branches/PHP_5_2/Makefile.gcov (working copy) @@ -5,24 +5,7 @@ lcov: lcov-html -lcov-test: all - @echo "Running test suite" - @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f - -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \ - elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \ - else \ - echo "ERROR: Cannot run tests without CLI sapi."; \ - fi +lcov-test: lcov-clean-data test php_lcov.info: lcov-test @echo "Generating data for $@" @@ -74,3 +57,5 @@ rm -rf lcov_data/ rm -rf lcov_html/ +lcov-clean-data: + @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f Index: branches/PHP_5_3/NEWS =================================================================== --- branches/PHP_5_3/NEWS (revision 300267) +++ branches/PHP_5_3/NEWS (working copy) @@ -67,6 +67,7 @@ requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas) +- Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick) - Fixed bug #51991 (spl_autoload and *nix support with namespace). (Felipe) - Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with constant array). (Felipe) Index: branches/PHP_5_3/Makefile.gcov =================================================================== --- branches/PHP_5_3/Makefile.gcov (revision 300267) +++ branches/PHP_5_3/Makefile.gcov (working copy) @@ -5,24 +5,7 @@ lcov: lcov-html -lcov-test: all - @echo "Running test suite" - @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f - -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \ - elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \ - NO_INTERACTION=1 \ - TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ - TEST_PHP_SRCDIR=$(top_srcdir) \ - CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \ - else \ - echo "ERROR: Cannot run tests without CLI sapi."; \ - fi +lcov-test: lcov-clean-data test php_lcov.info: lcov-test @echo "Generating data for $@" @@ -77,3 +60,5 @@ rm -rf lcov_data/ rm -rf lcov_html/ +lcov-clean-data: + @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f

Thread (48 messages)

« previous php.internals (#48682) next »