Hi Mathieu,
Le 09/02/2014 03:41, Mathieu Parent a écrit :
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.
Regards
David