Eunit test generators

Kenny Stone kennethstone at gmail.com
Fri Jul 22 19:08:33 EDT 2011


I really like the pattern of keeping my tests in a separate file, a
"foo_test.hrl" or "foo_test.erl", and I couldn't seem to get rebar to like
that pattern either.

On Fri, Jul 22, 2011 at 6:05 PM, Garrett Smith <g at rre.tt> wrote:

> On Fri, Jul 22, 2011 at 4:39 PM, Garrett Smith <g at rre.tt> wrote:
> > I have a test module that uses a test generator -- I need a
> > setup/cleanup fixture.
> >
> > I'm able to run the test fine when I explicitly specify the suite:
> >
> > rebar eunit suite=my_tests
> >
> > However, when I run the general command:
> >
> > rebar eunit
> >
> > the test isn't executed.
>
> This has nothing to do with generators.
>
> This is a test that doesn't have a corresponding module. E.g. the test
> is "foo_tests" but there's no "foo" module.
>
> I raised this issue earlier and the line is that "this is the way eunit
> works".
>
> Not really. If I want to run a test module under eunit, I can simply
> call eunit:test/1,2.
>
> Is there some reason rebar doesn't just run everything in "test"? If
> something can't be tested because it doesn't export test/0, just skip
> it.
>
> Garrett
>
> _______________________________________________
> rebar mailing list
> rebar at lists.basho.com
> http://lists.basho.com/mailman/listinfo/rebar_lists.basho.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/rebar_lists.basho.com/attachments/20110722/abf36a57/attachment-0001.html>


More information about the rebar mailing list