Page 1 of 1

Building a full test suite from simpletest

Posted: Mon Aug 06, 2007 2:26 pm
by Chris Corbyn
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.

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>
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? :)

Posted: Mon Aug 06, 2007 3:07 pm
by matthijs
Maybe suitetester

But you probably want something more?

Posted: Mon Aug 06, 2007 3:51 pm
by Chris Corbyn
Yeah that is pretty cool, but it doesn't offer what I'm looking for really. I'm effectively looking to make something that will "piece together" a test case, or a group of tests resolving all dependencies as it does so :)