[fpc-pascal] new FPCUnit feature - Register nested tests

Graeme Geldenhuys graemeg.lists at gmail.com
Mon May 21 16:50:09 CEST 2007


Hi,

Would this feature make the 2.2 release if I submit a patch? I need to
know for my own projects.  It is only two new functions. It allows you
to register tests and automatically builds the TestSuite structure for
you... Before you had to manually create the TestSuite's.

See the attached image for an example of one of these register lines:
Any combination is possible.

  if gTIOPFTestManager.TestNonPersistentClasses then
    RegisterTest('SuiteA', ATestCaseClass);

  if gTIOPFTestManager.TestNonPersistentClasses then
    RegisterTest('SuiteA.SuiteB.SuiteC', ATestCaseClass);

  if gTIOPFTestManager.TestNonPersistentClasses then
    RegisterTest('SuiteA/SuiteB/SuiteC', ATestCaseClass{$IFNDEF
FPC}.Suite{$ENDIF});

  if gTIOPFTestManager.TestNonPersistentClasses then
    RegisterTest('SuiteA\SuiteB\SuiteC', ATestCaseClass{$IFNDEF
FPC}.Suite{$ENDIF});

  if gTIOPFTestManager.TestNonPersistentClasses then
    RegisterTest('SuiteA.SuiteB\SuiteC/SuiteD', ATestCaseClass);


The SuitePath (first parameter of RegisterTest) can be any combination
of '.' or '\' or '/' to delimit a TestSuite. They will be created as
required and reused if they already exist.


-- 
Graeme Geldenhuys

General error, hit any user to continue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FPCUnit_nested_test.png
Type: image/png
Size: 4213 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070521/c45f6ad8/attachment.png>


More information about the fpc-pascal mailing list