Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-05

new FPCUnit feature - Register nested tests

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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.

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

I attached the unit I defined the two functions in. Please note, this is not a patch, it is just to show the implementation of the functions (for review). If it will make the 2.2 release, I will create a patch (and be able to delete my own unit).

Graeme.

Graeme Geldenhuys wrote 6 lines
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.
Graeme Geldenhuys General error, hit any user to continue.

Reply by email