The other answers here are correct. You can't do this using an xml config, what you can do though is make the same type of config in php.
It's certainly not the prettiest thing, but it should give you the functionality you would need.
You provided the xml config
<testsuites>
<testsuite name="Library">
<directory>library</directory>
</testsuite>
<testsuite name="XXX_Form">
<file>library/XXX/FormTest.php</file>
<directory>library/XXX/Form</directory>
</testsuite>
</testsuites>
Hypothetically, let's say your directory "library" contains 3 files:
library
XXX
FormTest.php
Unit
unittest1.php
unittest2.php
And that each of the files contains 1 test by perfect naming convention, eg: FormTest contains testForm()
For the config we'll create a config that contains everything:
<?php
include_once "library/XXX/FormTest.php";
include_once "library/Unit/unittest1.php";
include_once "library/Unit/unittest2.php";
Then we'll create a class by the phpunit naming conventions. You can name it whatever you want as we'll never actually use it...
class LibraryConfigTest extends PHPUnit_Framework_TestCase {
Each "test suite" will simply be a method that runs the tests you want. Name the methods whatever you want as, once again, we'll never actually use it. Phpunit will take care of the running. Be sure to comment them into groups though so you know how to execute.
/**
* All Tests in Library
* @group Library
**/
public function testLibrary() {
UnitTest1::testUnit1();
UnitTest2::testUnit2();
FormTest::testForm();
}
/**
* All Form tests in library/XXX
* @group XXX_Form
**/
public function testForm() {
FormTest::testForm();
}
}
?>
Now in order to get the functionality you want just run the "config" against the group you want.
phpunit --group XXX_Form library_config.php
phpunit --group Library library_config.php
As I said, this is ugly and certainly not good code as it will require constant maintenance,
but it will give you the functionality you're looking for.
Hopefully Bergmann will add this functionality in his next round although it doesn't seem likely as he appears to pretty much be ignoring it.