[erlang-questions] erlrt and eunit

Olivier Sambourg olivier.sambourg@REDACTED
Sat Oct 7 23:47:46 CEST 2006


Hi,

It ***may*** have to do with the order of your -compile and -include_lib
directives (because of the preprocess treatment applied by EUnit)
Can you try :

-module(mytest).
-include_lib("eunit/include/eunit.hrl").
-compile(export_all).

--
Olivier

On 10/7/06, Yanni Caouette <ycaouette@REDACTED> wrote:
>
> My bad! I have mytest.erl and test.erl, almost same except different
> module names. When editing the post, I used the error report for
> test.erl. Sorry for the confusion.
>
> I installed eunit-2.0 using erlrt. I am able to see it under
> erlrt/erlang/lib. (Starting with the minimum install, erlrt also
> picked up compiler-4.3.12, which I assume was due to dependency.)
>
> Here is the list of files in erlrt/erlang/lib/eunit-2.0:
>
> eunit-2.0/
> eunit-2.0/include
> eunit-2.0/include/eunit_test.hrl
> eunit-2.0/include/eunit_off.hrl
> eunit-2.0/include/eunit_auto.hrl
> eunit-2.0/include/eunit.hrl
> eunit-2.0/ebin
> eunit-2.0/ebin/eunit_test.beam
> eunit-2.0/ebin/code_monitor.beam
> eunit-2.0/ebin/eunit_autoexport.beam
> eunit-2.0/ebin/file_monitor.beam
> eunit-2.0/ebin/eunit_tty.beam
> eunit-2.0/ebin/eunit_proc.beam
> eunit-2.0/ebin/eunit_data.beam
> eunit-2.0/ebin/eunit_lib.beam
> eunit-2.0/ebin/autoload.beam
> eunit-2.0/ebin/eunit_server.beam
> eunit-2.0/ebin/eunit_serial.beam
> eunit-2.0/src
> eunit-2.0/src/test.erl
> eunit-2.0/src/eunit_tty.erl
> eunit-2.0/src/eunit_data.erl
> eunit-2.0/src/eunit_test.erl
> eunit-2.0/src/eunit_internal.hrl
> eunit-2.0/src/eunit_server.erl
> eunit-2.0/src/eunit.erl
> eunit-2.0/src/eunit_lib.erl
> eunit-2.0/src/code_monitor.erl
> eunit-2.0/src/eunit_serial.erl
> eunit-2.0/src/autoload.erl
> eunit-2.0/src/eunit_proc.erl
> eunit-2.0/src/Makefile
> eunit-2.0/src/file_monitor.erl
> eunit-2.0/src/eunit_autoexport.erl
> eunit-2.0/doc
> eunit-2.0/doc/NOTES.txt
> eunit-2.0/doc/overview.edoc
>
> Here is mytest.erl.
>
> -module(mytest).
> -compile(export_all).
> -include_lib("eunit/include/eunit.hrl").
>
> my1_test() -> ?assert(1 == 1).
> my2_test() -> ?assertNot(0 == 1).
>
> And here is the output.
>
> Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0]
>
> Erlang/OTP R10B-10 linux-x86 stripped runtime environment
> Eshell V5.4.13  (abort with ^G)
> 1> c(mytest).
> {ok,mytest}
> 2> mytest:test().
>
> =ERROR REPORT==== 7-Oct-2006::17:32:11 ===
> Error in process <0.30.0> with exit value:
>
> {undef,[{mytest,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}
>
> ** exited: {undef,[{mytest,test,[]},
>                    {erl_eval,do_apply,5},
>                    {shell,exprs,6},
>                    {shell,eval_loop,3}]} **
>
> Thanks for your help.
>
> Yanni
>
> On 10/7/06, Richard Carlsson <richardc@REDACTED> wrote:
> > Yanni Caouette wrote:
> > > Then I tried to compile a module. No problem.
> > > 2> c(mytest).
> > > {ok,mytest}
> > >
> > > When running the test, I was encountered with this error.
> > > 3> mytest:test().
> > > =ERROR REPORT==== 7-Oct-2006::16:30:24 ===
> > >
> {undef,[{test,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}
> > >
> > > It looked as if the function mytest:test() is not auto exported by
> > > eunit. Any idea?
> >
> > Something is odd with that report: it says that "test:test()" is
> > undefined, but you called "mytest:test()". Also, I don't know what
> > version of eunit that you get if you use erlrt, so it's a bit hard to
> > know what could be wrong.
> >
> >         /Richard
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061007/dcd612df/attachment.htm>


More information about the erlang-questions mailing list