Building a full test suite from simpletest
Posted: Mon Aug 06, 2007 2:26 pm
I'm planning on wrapping a nice test suite around simpletest to make it easier to manage projects where you end up with half a million testcases. Anyone using Swiftmailer from SVN may have noticed all the Unit Tests being bundled into a crappy suite which lets you run multiple grouped tests a little easier in a hierarchical fashion, but I'm not happy with that at all.
I'm planning on something which (if run in a web brower) lists all available tests down one panel at the left of screen and lets you run them individually. I'd also like to maintain the ability to check/uncheck a little box next to each test case so I can run a custom group test. Half of the reason I don't like the rushed suite I've written now is the way I include files needed to support the tests (Mocks, classes etc). It's just a bit clumsy in the sense that it includes everything all the time.
I'm thinking of using some sort of XML configuration and parsing it out with XPath queries:
This just came from a little brainstorming I was doing.
It still feels a bit tedious but I'm sure I could come up with some ways to save on typing. The most important question though... does anything even vaguely like this already exist? 
I'm planning on something which (if run in a web brower) lists all available tests down one panel at the left of screen and lets you run them individually. I'd also like to maintain the ability to check/uncheck a little box next to each test case so I can run a custom group test. Half of the reason I don't like the rushed suite I've written now is the way I include files needed to support the tests (Mocks, classes etc). It's just a bit clumsy in the sense that it includes everything all the time.
I'm thinking of using some sort of XML configuration and parsing it out with XPath queries:
This just came from a little brainstorming I was doing.
Code: Select all
<testcase-list>
<property key="classpath" value="/some/classes" />
<property key="testpath" value="testcases" />
<reporter type="auto" />
<testcase>
<name>Test Of SMTP</name>
<class name="TestOfSmtp" path="${testcases}" />
<depends>
<file path="${classpath}/Swift.php" require_once="true" />
<mock fromclass="Swift_Connection_SMTP" path="${classpath}/Swift/Connection/SMTP.php" toclass="MockConnection" />
<method>doFoo</method>
</mock>
</depends>
</testcase>
<testcase>
....
</testcase>
</testcase-list>