Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/regress/lib/libc



On Sat, Jan 19, 2008 at 09:17:40PM +0100, Julio M. Merino Vidal wrote:
> On Jan 19, 2008, at 5:10 PM, Brian Ginsbach wrote:
> 
> >On Sat, Jan 19, 2008 at 03:19:13PM +0200, Antti Kantee wrote:
> >>
> >>Shouldn't new tests be written for atf instead of the old  
> >>framework?  >
> >
> >It would if the ATF API was in C :-(.  I was easily able to knock
> >this out.  I did look at the ATF stuff but the lack of API
> >documentation, harry C++ macroness and no C API kept me away.  I
> >felt some test is better than no test.
> 
> The macros are there, precisely, to hide many C++ constructions that  
> many developers would not be comfortable about.  In many cases, your  
> tests will only include a couple of macros here and there, and then  
> include your plain C testing code.  Voila, no visible C++ code.
> 

Personally I'd like no C++ at all.  For C it would be nice to just
#include <atf/atf.h> or similar.

I also think it would be better not to rely on macro magic even
for C++.  If macros are needed to hide the complexity then maybe
that says something?

It didn't seem that the macros would work very well inside a loop.  It
made no sense to write basically the same test either as several source
files or as sequences of AFT_TEST_CASE(), ATF_TEST_CASE_HEAD(),
ATF_TEST_CASE_BODY().  Nor did it seem like ATF would lend it self to
a data-driven test driver for a function.

> >On Sat, Jan 19, 2008 at 02:43:33PM +0100, Julio M. Merino Vidal wrote:
> >>
> >>In my opinion, yes.  I'm trying to get atf 0.4 out of the door soon,
> >>which brings some needed API-related documentation that will be
> >>hopefully useful to those writing new tests.
> >
> >Maybe.  It would have certainly have helped.  But IMHO w/o a C API
> >it is less useful.  I also get the feeling that ATF may have an
> >incomplete API.
> 
> I have a C-only API in mind... but that will take a non-trivial  
> amount of effort to write.

I can believe it because the C++ looks very complicated.  I'd like
to help if I could.  I can see where the reliance on multiple
classes, inheritance, etc. will make coming up with a C-only API
non-trivial.

Have you looked at the C API used by the Linux Test Project (LTP)?
I believe that at least this part of the LTP and ATF are trying to
solve the same "problem".  (Note I have a little experience with
a LTP predecessor -- recall that SGI gave LTP to the Linux community
-- ask off-list if your interested in more details.)



Home | Main Index | Thread Index | Old Index