Re: [Cppunit-devel] examples on webpage.
Brought to you by:
blep
From: Bart W. <whi...@ll...> - 2003-02-24 21:12:56
|
On Mon, Feb 24, 2003 at 09:58:41PM +0100, Thomas Zander wrote: > > Thanx! This one actually compiled :) > It took some time to get a correct install; my debian version did not link. > I had to compile the sources. > So, I'm of in creating more testunits! > Glad I could help. > > btw; your testrunner: > > > bool wasSucessful = runner.run( "", false ); > > return wasSucessful; > > seems wrong; wasSucessful is 1 when everything went right, but returning > 0 is the 'success' return state of main. > So I believe it should be > if(wasSucessful) return 0; > return -1; > > And if you want to assume the implied values of the bool (sounds dirty ;). > return !wasSucessful; > Correct. I was trying to stay as close to the cookbook as possible. See attachment for my real testrunner.cc. It also adds the feature of passing a command line param to run a single test suite or single unit. ./testrunner TestSuiteName or ./testrunner TestSuiteName::UnitTestName -- Bart Whiteley Computer Scientist voice: (925) 423-2249 National Atmospheric Release Advisory Center FAX: (925) 423-8274 Lawrence Livermore National Laboratory email: whi...@ll... P.O. Box 808, Livermore, CA 94551-0808 MS: L-103 |