|
From: Ricardo S. <rik...@gm...> - 2007-09-11 20:17:48
|
On 9/11/07, Pedro Angelo <pa...@dc...> wrote: > > On Mon, 10 Sep 2007 23:49:09 +0100 > Guilherme Santos <gui...@gm...> wrote: > > > Speaking on tests. > > I'm using CppUnit to keep my tests organized (I have only one at this > > moment). Another advantage is that is easy to add or remove tests and > > keep everything running. > > > > But this approach has several disadvantages too. > > It's implemented in C++ and if we think in (possible) future > > platforms such as mobile, it could be more complicated to get the > > framework compiling for that platforms. > > > > Anyway, it's easy to copy the tests code and use it to build a > > simpler test unit. > > > > What are you planning to test the freekode? > > If you guys think it's better to build another approach, it's easy > > for me to copy the code I have done. > > > > For the moment, I'll continue to use the cppunit to test my stuff :) > > > > > > Cheers, > > Guilherme Santos > > Hi Guilherme, > > I've also been thinking about this, and to make the code as portable as > possible we probably should create our own mini test suite in ANSI C > and expand it as need arises. > > I've had some experience testing C code with Check and although it's > cleverly designed to avoid C's pitfalls in regards to testing code, it > falls a bit short on portability for more exotic platforms because it > relies on certain UNIX functions like fork() and vsnprintf(). A few > years back I tried porting it to a DEC Alpha workstation only to > realize that not all UNIX environments have vsnprintf()... > > Since openKode targets embedded platforms I'm expecting that we can't > count on much more than a working ANSI C compiler. > > So anyway, back to the idea of a minimalistic test framework what do you > guys prefer: > > a) Each test is an executable in a special "test dir" and a test runner > app runs each test it finds via system() and reports the output. > > b) Each test is a function (usually a macro) and the test runner just > calls the functions iteratively (this usually requires a fork() to > avoid a bad test crashing the test runner) > > I'm currently leaning towards option a) but I can use whatever > alternative you feel more comfortable with. > > Cheers, > p. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Freekode-public mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freekode-public > I also agree that tests should be made ANSI C compatible to make sure they run in most (if not all) platforms. I'd also go for option a). Regards, Ricardo. |