[erlang-questions] Problem running meck

Torben Hoffmann <>
Sat Oct 13 22:45:01 CEST 2012


Hi,

I have created a rebar.config for my chronos project - 
https://github.com/lehoff/chronos.git - but I am having problems getting 
my example to work.

I am starting my shell like this:
|    erl -pz examples -pz deps/*/ebin -pz ebin||
|
Then I am trying to run the ping_test:run_test/0, but it fails misserably:
1> ping_test:run_test().
** exception exit: undef
      in function  chronos_meck_original:start_link/1
         called as chronos_meck_original:start_link(ping_timer_server)
      in call from meck:exec/5 (src/meck.erl, line 418)
      in call from chronos:start_link/1
         called as chronos:start_link(ping_timer_server)
      in call from ping:init/1 (examples/ping.erl, line 47)
      in call from gen_server:init_it/6 (gen_server.erl, line 304)
      in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 227)

=ERROR REPORT==== 13-Oct-2012::22:28:13 ===
** Generic server chronos_meck terminating
** Last message in was {'EXIT',<0.31.0>,
                            {undef,
[{chronos_meck_original,start_link,
[ping_timer_server],
                                     []},
                                 {meck,exec,5,
[{file,"src/meck.erl"},{line,418}]},
{chronos,start_link,[ping_timer_server],[]},
                                 {ping,init,1,
[{file,"examples/ping.erl"},{line,47}]},
                                 {gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}}
** When Server state == {state,chronos,
                             {dict,10,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                  []},
                                 {{[],[],
[[{code_change,3}|passthrough]],
[[{handle_info,2}|passthrough]],
                                   [],[],
[[{start_link,1}|passthrough],
[{stop_timer,2}|passthrough]],
                                   [],
                                   [[{start_timer,4}|
#Fun<ping_test.0.90280136>],
[{handle_cast,2}|passthrough]],
[[{handle_call,3}|passthrough],
[{terminate,2}|passthrough]],
                                   [],
[[{stop,1}|passthrough]],
                                   [],[],[],
[[{init,1}|passthrough]]}}},
                             false,
                             [{<0.44.0>,
{chronos,start_link,[ping_timer_server]},
                               error,undef,
[{chronos_meck_original,start_link,
                                    [ping_timer_server],
                                    []},
                                {meck,exec,5,
[{file,"src/meck.erl"},{line,418}]},
{chronos,start_link,[ping_timer_server]},
                                {ping,init,1,
[{file,"examples/ping.erl"},{line,47}]},
                                {gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}],
                             {false,no_binary},
                             false}
** Reason for termination ==
** {'module could not be loaded',
[{chronos_meck_original,start_link,[ping_timer_server],[]},
{meck,exec,5,[{file,"src/meck.erl"},{line,418}]},
         {chronos,start_link,[ping_timer_server],[]},
{ping,init,1,[{file,"examples/ping.erl"},{line,47}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
2>

It seems that the mocking is not working as it should, but I cannot 
figure out what is the problem.
I have also tried to run things from the ebin directory, but it still fails.

Any advice on how to get this to work is most welcome!

Cheers,
___
  /orben

-- 
http://www.linkedin.com/in/torbenhoffmann

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121013/afdcb2d2/attachment.html>


More information about the erlang-questions mailing list