[fpc-pascal] FPCUnit - how to register decorator tests?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Tue Jul 21 00:00:25 CEST 2015


Hi,

Please see attached test project. I have a decorator class and a test
class. In the initialization section I call RegisterTestDecorator(), but
when I run the test suite, it shows 0 tests ran and 0 tests available in
the test suite. I'm using FPC 2.6.4.

How do you use test decorators in FPCUnit?

Here is the output.

=======================================
$ ./project1 --format=plain -l
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
TestSuites:
=======================================

=======================================
$ ./project1 --format=plain -a
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
calling....  constructor TMySpeedTest.Create
 Time:00.000 N:0 E:0 F:0 I:0

Number of run tests: 0
Number of errors:    0
Number of failures:  0

=======================================


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
-------------- next part --------------
program project1;

{$mode objfpc}{$H+}

uses
  consoletestrunner, fpcunit, speedtests;

var
  lApp: TTestRunner;
begin
  lApp := TTestRunner.Create(nil);
  try
    lApp.Run;
  finally
    lApp.Free;
  end;
end.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: speedtests.pas
Type: text/x-pascal
Size: 1483 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150720/f5f7d98b/attachment.pas>


More information about the fpc-pascal mailing list