[pkg-php-pear] Bug#755442: Running tests at build time

David Prévot david at tilapin.org
Sun Jul 20 21:25:03 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Package: pkg-php-tools
Version: 1.12
Severity: wishlist

Hi Mathieu,

Le 09/02/2014 03:41, Mathieu Parent a écrit :


> We can add buildtime check to pkg-php-tools but we should ensure that
> there is a guessable command to run.

Now that we have about twenty packages that recently added their test
suite at build time, it looks like the usage is that upstream drops a
phpunit.xml.dist file at the root, and we then add the following into
debian/rules:

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
        phpunit
else
        @echo "** tests disabled"
endif


The second alternative usage is that upstream drops a tests/phpunit.xml
file, and we then add the following into debian/rules:

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
        cd tests && phpunit
else
        @echo "** tests disabled"
endif


I didn’t yet come across many PEAR packages with a proper phpunit
testsuite, but it looks like the usage is similar (with phpunit.xml.dist
or tests/phpunit.xml dropped in the PEARName-Version directory instead
of the root one, and thus an additional “cd PEARName-Version” in
debian/rules).

Some tests suite can run with phpunit even if no phpunit.xml{,.dist}
file is provided, but checking it existence as an heuristic looks like a
fair first step before we have a better idea of how to handle them.


Even if it usually needs additional patches to actually run the test
suite, providing those default dh_auto_test rules by pkg-php-tools
should be an improvement. I’d be happy to help fixing any packge that
will FTBFS if such a change were added soon enough before the freeze.

> 2014/2/9 David Prévot <david at tilapin.org>:

> [...]
>> Side note: I had to mimic the Composer autoload feature [4] (via
>> ClassLoader from Symfony), no idea if pkg-php-tools could be improved to
>> create an autoload file, nor if php-composer could help (maybe andrea
>> would know).
> I thought that there were no good way to have the Composer autoload
> systemwide, untill I read this message:
> 
> http://lists.kolab.org/pipermail/devel/2014-February/014896.html
> 
> However, I'm currently too busy (and don't maintain any composer
> package) to add this feature soon.


Regards

David


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCAAGBQJTzDOvAAoJEAWMHPlE9r08z4wH/2xciH0OP5378KMlOFinxclW
1igMmGf19I+EIAIyNtpr7T6k6bv8sIkqBL2gz1px1mMkqmQbWUlBTzcvFVPP5S32
X6rUOlQMA/yBBGR8hGj4QRAoMVtSdZ8B68l9inp8GxFQhZymFsL17NMwL1SAOm9a
i2unx6ytaEvG6voLIHa4YV21kb9k7DiVbnX0dANrbRuicU9pb3eaJnSzGAyibi7n
CSFrXWq4nZlV3g5WDvu8/WQOZ97nHjK0dK566qxUiNzZ+TkpaQ81n8+ZGhj+FVew
ALr34pQbVQ+EmRQ2qBSAdYQ+Sk702Jik/SvaQQA5YSXs0v87IglP6AUkuSpYDdo=
=ZPhG
-----END PGP SIGNATURE-----



More information about the pkg-php-pear mailing list