On 2015-07-20 23:00, Graeme Geldenhuys wrote:
> How do you use test decorators in FPCUnit?

Just a follow-up on what was wrong. My usage and registration of a
decorator was correct, but I believe I uncovered another bug in FPCUnit,
hence my test suite reported 0 tests.

The FPCUnit's decorator is a class and has two overloaded constructors.
In my TRepeatableTest decorator I used the constructor to set up some
stuff I needed, but for some magical reason the decorator class's
constructors are somehow NEVER called (simple writeln() can confirm
that). That in turn rendered my example test project useless with no
tests running at all.

To fix my problem with the TRepeatedTest decorator, I had to override
the Run() method (which is actually called), and place all my setup code
there, and remove any usage of the constructors in the decorator class.
After that my TRepeatedTest decorator worked.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to