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