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

Re: Another testing issue with signatures



OUnit tests need to be run from somewhere: where? You could define a special 
"test" function like main() currently and call into that from outside, but it's 
a bit odd if every signature has a "test" function that destroys data :)

The batteries extension does look quite handy though: I like the ideas of quick 
little tests alongside a function definition...

Anil

On 16 Sep 2011, at 08:16, Raphael Proust <raphlalou@xxxxxxxxx> wrote:

> Can't oUnit take care of precisely that?
> 
> Also, Batteries have a syntax extension that changes special kinds of
> comments into a unit test (see Test on
> https://github.com/ocaml-batteries-team/batteries-included/wiki/Developers-guidelines
> )
> 
> On 9/15/11, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
>> Something just occurred to me: we also need a way to write tests *inside* a
>> module, rather than the current model where the tests are run as external
>> Mirage programs.
>> 
>> The reason for this is that we restrict the external interfaces to the safe
>> signatures (e.g. abstract type t), and so the only place the test can
>> compile is within the implementation itself.
>> 
>> Or (a bit more radically), we could compile up a 'naked Mirage' with none of
>> the MLI files present, which should be strictly more expressive, and simply
>> run the tests externally as we currently do.  That should be reasonably easy
>> to do as the only place we actually compile anything is in
>> _build/<backend>/std (libraries are source copied in there)...
>> 
>> Anil
>> 
> 
> 
> -- 
> _______
> Raphael
> 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.