lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe_schae...@yahoo.com>
Subject Re: [lucy-dev] C TAP test harnesses
Date Fri, 13 May 2011 04:59:47 GMT
----- Original Message ----

> From: Marvin Humphrey <marvin@rectangular.com>
> To: lucy-dev@incubator.apache.org
> Sent: Fri, May 13, 2011 12:33:06 AM
> Subject: [lucy-dev] C TAP test harnesses
> 
> On Thu, May 12, 2011 at 05:24:14PM -0700, Joe Schaefer wrote:
> > >    * Port most test files  within trunk/perl/t/ to C.
> > 
> > If  we're in need of a test framework for C I wrote a small TAP-compliant
> >  test framework for apreq here:
> > 
> >  http://svn.apache.org/repos/asf/httpd/apreq/trunk/library/t/
> 
> Great minds  think alike.  We have two of those. :)
> 
>      http://svn.apache.org/repos/asf/incubator/lucy/trunk/core/Lucy/Test.cfh
>       http://svn.apache.org/repos/asf/incubator/lucy/trunk/core/Lucy/Test.c
> 
>       
>http://svn.apache.org/repos/asf/incubator/lucy/trunk/charmonizer/src/Charmonizer/Test.h
>
>       
>http://svn.apache.org/repos/asf/incubator/lucy/trunk/charmonizer/src/Charmonizer/Test.c
>
> 
> (And  another Lucy community member, David Wheeler, authored a JavaScript port
> of  Test.Simple a few years ago.)
> 
> An additional related project of note is  APR's test harness, which isn't TAP.
> 
>      http://svn.apache.org/repos/asf/apr/apr/trunk/test/abts.h
>      http://svn.apache.org/repos/asf/apr/apr/trunk/test/abts.c
> 
> Aside from  TAP/no-TAP, these test harness libraries are distinguished by  
>their
> dependencies.
> 
>      ==================================================================
>      | Test harness   |  TAP  |  Dependencies                           |
>      ------------------------------------------------------------------
>      | APR            |  no   |  none                                   |
>     | apreq           |  yes  | APR                                     |
>     | Charmonizer    |  yes  |  none                                   |
>     | Lucy/Clownfish  |  yes  | C99/C++, Charmonizer, Clownfish        |
>      ==================================================================
> 
> The  Lucy/Clownfish test harness is a fork of the one written  for
> Charmonizer[1].  We have a lot of tests for Lucy, and we're going  to
> accumulate a lot more over time.  It makes sense to have a  C99,
> Clownfish-friendly test harness we can customize at will -- so this one,  IMO,
> we ought to keep.
> 
> In contrast, now that Lucy no longer uses the  Charmonizer test harness, it's
> become less important to us and it would be  kind of nice to consolidate it
> away.  The apreq harness isn't a good  replacement candidate in its present
> form, though, because it requires  APR.  That leaves the APR test harness.
> It's not TAP, though.  I  like TAP.  I'm not motivated to do a bunch of work
> refactoring something  that's TAP and working already.

FWIW the features in the apreq stuff that are nice for me are

1) macros provide access to __FILE__ and __LINE__ in the test source file,
which an emacs compile buffer will understand when written appropriately to 
stdout.

2) skip lists, todo lists, and fatals are supported.

3) there is a localizer which allows you to next test frameworks.  it basically
supplies its own harness and treats all subtest errors as fatal- handy if you're
running a tight loop of tests and really aren't interested in feeding all that 
data
directly to stdout.

The apr dependency is just because apreq has a core dependency on apr, so why 
not.
It could be dropped without much effort, or these features added to the
existing Lucy C test apparatus.

 
> For the record, there are also all of  these out there in the world:
> 
>      http://testanything.org/wiki/index.php/TAP_Producers#C_.2F_C.2B.2B
> 
> It  seems like the ASF could use a decent standalone C TAP library with  an
> official public API, C89, cross-platform-compatible and with no  dependencies.
> 
> Marvin Humphrey
> 
> [1] Charmonizer is a C configuration  prober, like Autoconf and Metaconfig, 
but
>     written in C and  Windows-compatible.  See Lucy::Docs::DevGuide for an
>      overview of Lucy's layers:
>     
>https://svn.apache.org/repos/asf/incubator/lucy/trunk/core/Lucy/Docs/DevGuide.cfh
>
> 
> 

Mime
View raw message