Re: Fixing make lcov with TESTS variable

From: Date: Mon, 07 Jun 2010 09:00:56 +0000
Subject: Re: Fixing make lcov with TESTS variable
References: 1 2 3  Groups: php.qa 
Request: Send a blank email to php-qa+get-65573@lists.php.net to get a copy of this 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 > Nuno > > > ----- Original Message ----- >> >> Felix, >> >> Since Jani (the build expert) isn't active, check with Nuno on this. >> It would be good to have a fix so I don't have to keep editing the >> Makefile! >> >> It seems inherently wrong to ignore the variable: perhaps the intent >> was for it to be set in the parent shell like you set PHP_EXECUTABLE. >> I notice phpize installs from PECL will set the variable in the >> Makefile (though there is no Makefile.gcov). >> >> Chris >> >> On 06/05/2010 07:07 AM, Felix De Vliegher wrote: >>> >>> Hi all >>> >>> During our testfest, Patrick Allaert was looking at fixing the issue when >>> you want to get code coverage for only a specific part of the testsuite, eg: >>> $ make lcov TESTS=ext/date/ >>> >>> This wasn't working anymore for quite some time, with the cause being an >>> error in the generated makefile. I've created a diff for Makefile.gcov, >>> which is used to generate the Makefile when configuring PHP. The issue here >>> is that $(PHP_MODULES) is always empty, and sourcing it doesn't work. Also, >>> the tests/ directory was hardcoded instead of using the $(TESTS) variable. >>> >>> ~/svn/php-5.3$ svn diff Makefile.gcov >>> Index: Makefile.gcov >>> =================================================================== >>> --- Makefile.gcov       (revision 300180) >>> +++ Makefile.gcov       (working copy) >>> @@ -13,7 +13,7 @@ >>>                 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/; \ >>> +                       $(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/' $(TESTS); \ >>>         elif test ! -z "$(SAPI_CLI_PATH)"&&  test -x >>> "$(SAPI_CLI_PATH)"; >>> then \ >>>                 NO_INTERACTION=1 \ >>>                 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ >>> >>> >>> Is there an issue if I'd commit this? >>> >>> >>> Regards, >>> Felix > > > -- > PHP Quality Assurance Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.qa (#65573) next »