[fpc-devel] fpcUnit demo error

Leonardo M. Ram� martinrame at yahoo.com
Fri Sep 15 13:58:36 CEST 2006


Sorry, i thought frameworktest was the correct one.


--- Dean Zobec <dezobec at tin.it> wrote:

> Leonardo M. Ramé ha scritto:
> > People, just found an error in the consolerunner/testrunner.pp demo application. It's
> constructor
> > and destrutor differs from the frameworktest sample in the tests directory.
> > 
> > The correct methods are:
> > 
> > constructor TTestRunner.Create(AOwner: TComponent);
> > begin
> >   inherited Create(AOwner);
> >   FXMLResultsWriter := TXMLResultsWriter.Create;
> >   FSuite := TTestSuite.Create;
> >   FSuite.TestName := 'Framework test';
> >   FSuite.AddTestSuiteFromClass(TAssertTest);
> >   FSuite.AddTest(TSuiteTest.Suite());
> > end;
> > 
> > destructor TTestRunner.Destroy;
> > begin
> >   FXMLResultsWriter.Free;
> >   FSuite.Free;
> > end;
> 
> No, this is not an error, the test runner in the tests directory runs
> the tests of fpcunit itself, so it intentionally does not use the
> fpcunit automation to build the testcases through the methods in the
> testregistry unit. In fact in the constructor the TTestSuite is built
> manually. Sometimes you have to act this way (e.g.  where you  need some
> parameterized test cases).
> Whereas the test runner in the demo directory uses the registration
> mechanism to build the test cases. But there IS an error in the
> testrunner in the demo directory, the unit testreport was substituted
> with the new xmlreporter that lacks some methods used by the runner.
> For Vincent: what if we simply use here your text test runner in the
> lazarus/test directory? I'll prepare a patch.
> Ciao, Dean
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 


Leonardo M. Ramé
http://leonardorame.blogspot.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the fpc-devel mailing list