Whence eunit:test/0?

Roger Lipscombe roger@REDACTED
Fri Nov 15 21:47:05 CET 2019


Ah. Specifically this:
https://github.com/erlang/otp/blob/master/lib/eunit/src/eunit_autoexport.erl#L89

Module:test() -> eunit:test(Module).

...which invokes the test cases in Module *and* Module_tests. In the
case of eunit_tests, there are 6 tests.

It's been a long day.

On Fri, 15 Nov 2019 at 20:29, Brujo Benavides <elbrujohalcon@REDACTED> wrote:
>
> It’s the magic of parse transforms!
>
> eunit.erl includes eunit.hrl: https://github.com/erlang/otp/blob/8e4abc44d58e61753716e63b23c6b44d221feb15/lib/eunit/src/eunit.erl#L30
>
> When you include that header file, it will create a test/0 function for you.
> Check it out: http://erlang.org/doc/apps/eunit/chapter.html#running-eunit
>
> ________________________________
> Brujo Benavides
>
>
>
> On 15 Nov 2019, at 17:24, Roger Lipscombe <roger@REDACTED> wrote:
>
> 1> eunit:test().
>  All 6 tests passed.
> ok
>
> But there's no `test/0` function *in* eunit.erl. What's going on?
>
>



More information about the erlang-questions mailing list