eproxus / meck

A mocking library for Erlang
http://eproxus.github.io/meck
Apache License 2.0
813 stars 231 forks source link

Allow meck to build under Erlang 17.0-rc2 and Erlang R16B03-1 #118

Closed myers closed 10 years ago

myers commented 10 years ago

See this thread about the change.

eproxus commented 10 years ago

Hmm, this seems to break edoc. Do you know if dict:dict() is allowed on R16/R15 (cannot verify this myself at the moment)? If so, we could just use the new format.

myers commented 10 years ago

Do you know if dict:dict() is allowed on R16/R15

Sadly no. You can try it by replacing dict() with dict:dict() and you get this error

src/meck_proc.erl:52: referring to built-in type dict as a remote type; please take out the module name

I also tried to add

-import(dict)

to see if that worked. If you read the thread I link to you'll see they suggested a macro like I wrote here.

myers commented 10 years ago

Since a broken edoc is worse than breaking the build when there is a warning another solution would be to remove the warnings_as_errors option in rebar.config.

eproxus commented 10 years ago

Hmm, right now the doc doesn't seem to build add all, so in fact, this is not a proper solution really. If you can figure out a way to solve this with macros without breaking edoc, that would be nice.

Perhaps something along these lines?

-ifdef(NAMESPACED_DICTS).
-type meck_dict() :: dict:dict().
-else.
-type meck_dict() :: dict().
-end.
myers commented 10 years ago

That worked!

norton commented 10 years ago

Just curious.

Does that work as well when you run dialyzer under old and new versions of Erlang/OTP?

On 2014/03/12, at 15:17, Myers Carpenter notifications@github.com wrote:

That worked!

— Reply to this email directly or view it on GitHub.

edgurgel commented 10 years ago

Shall we add 17.0-rc1 to .travis.yml list of OTP releases ?

eproxus commented 10 years ago

@myers @norton Can you test if this works with dialyzer?

@edgurgel If Travis supports it, that would be nice. Then we can just change it to 17.0 once it is final.

myers commented 10 years ago

Here is the output of make dialyzer on Erlang 17.0-rc2

myers@badger:~/p/forks/meck$ make dialyzer
==> meck (compile)
dialyzer --build_plt --apps kernel stdlib eunit tools compiler -r deps --output_plt /Users/myers/p/forks/meck/.deps.plt
  Compiling some key modules to native code... done in 0m47.18s
  Creating PLT /Users/myers/p/forks/meck/.deps.plt ...
eunit_test.erl:305: Call to missing or unexported function eunit_test:nonexisting_function/0
Unknown functions:
  crypto:block_decrypt/4
  crypto:block_encrypt/4
  crypto:start/0
  dbg:trace_client/3
  dbg:trace_port/2
  erl_prim_loader:get_cwd/0
  erl_prim_loader:get_cwd/1
  erl_prim_loader:get_file/1
  erl_prim_loader:get_path/0
  erl_prim_loader:list_dir/1
  erl_prim_loader:prim_get_cwd/2
  erl_prim_loader:prim_get_file/2
  erl_prim_loader:prim_init/0
  erl_prim_loader:prim_list_dir/2
  erl_prim_loader:prim_read_file_info/2
  erl_prim_loader:read_file_info/1
  erl_prim_loader:set_primary_archive/4
  erlang:atom_to_list/1
  erlang:binary_to_list/1
  erlang:binary_to_list/3
  erlang:binary_to_term/1
  erlang:bitstring_to_list/1
  erlang:call_on_load_function/1
  erlang:cancel_timer/1
  erlang:check_old_code/1
  erlang:check_process_code/3
  erlang:date/0
  erlang:delete_module/1
  erlang:demonitor/1
  erlang:demonitor/2
  erlang:display/1
  erlang:dt_restore_tag/1
  erlang:dt_spread_tag/1
  erlang:erase/0
  erlang:erase/1
  erlang:exit/2
  erlang:external_size/1
  erlang:finish_after_on_load/2
  erlang:float_to_list/1
  erlang:fun_info/2
  erlang:fun_to_list/1
  erlang:function_exported/3
  erlang:garbage_collect/0
  erlang:garbage_collect/1
  erlang:get/0
  erlang:get/1
  erlang:get_module_info/1
  erlang:get_module_info/2
  erlang:get_stacktrace/0
  erlang:group_leader/0
  erlang:group_leader/2
  erlang:hibernate/3
  erlang:integer_to_list/1
  erlang:iolist_size/1
  erlang:iolist_to_binary/1
  erlang:is_alive/0
  erlang:is_builtin/3
  erlang:is_process_alive/1
  erlang:link/1
  erlang:list_to_atom/1
  erlang:list_to_binary/1
  erlang:list_to_bitstring/1
  erlang:list_to_existing_atom/1
  erlang:list_to_float/1
  erlang:list_to_integer/1
  erlang:list_to_integer/2
  erlang:list_to_pid/1
  erlang:list_to_tuple/1
  erlang:load_module/2
  erlang:localtime/0
  erlang:localtime_to_universaltime/1
  erlang:localtime_to_universaltime/2
  erlang:make_fun/3
  erlang:make_ref/0
  erlang:match_spec_test/3
  erlang:max/2
  erlang:md5/1
  erlang:md5_final/1
  erlang:md5_init/0
  erlang:md5_update/2
  erlang:memory/1
  erlang:min/2
  erlang:module_loaded/1
  erlang:monitor/2
  erlang:monitor_node/2
  erlang:monitor_node/3
  erlang:nodes/0
  erlang:nodes/1
  erlang:now/0
  erlang:open_port/2
  erlang:phash/2
  erlang:phash2/1
  erlang:pid_to_list/1
  erlang:port_close/1
  erlang:port_command/2
  erlang:port_connect/2
  erlang:port_control/3
  erlang:port_get_data/1
  erlang:port_info/2
  erlang:port_set_data/2
  erlang:port_to_list/1
  erlang:ports/0
  erlang:pre_loaded/0
  erlang:process_display/2
  erlang:process_flag/2
  erlang:process_info/1
  erlang:process_info/2
  erlang:processes/0
  erlang:purge_module/1
  erlang:put/2
  erlang:raise/3
  erlang:read_timer/1
  erlang:ref_to_list/1
  erlang:register/2
  erlang:registered/0
  erlang:send/3
  erlang:send_after/3
  erlang:seq_trace/2
  erlang:seq_trace_info/1
  erlang:seq_trace_print/1
  erlang:seq_trace_print/2
  erlang:setnode/2
  erlang:setnode/3
  erlang:spawn/3
  erlang:spawn_link/3
  erlang:spawn_monitor/1
  erlang:spawn_monitor/3
  erlang:spawn_opt/2
  erlang:spawn_opt/4
  erlang:spawn_opt/5
  erlang:split_binary/2
  erlang:start_timer/3
  erlang:statistics/1
  erlang:system_flag/2
  erlang:term_to_binary/1
  erlang:term_to_binary/2
  erlang:trace/3
  erlang:trace_delivered/1
  erlang:trace_info/2
  erlang:trace_pattern/3
  erlang:universaltime/0
  erlang:universaltime_to_localtime/1
  erlang:unlink/1
  erlang:unregister/1
  erlang:whereis/1
  erts_internal:cmp_term/2
  hipe:compile/4
  httpd:parse_query/1
  init:archive_extension/0
  init:code_path_choice/0
  init:ensure_loaded/1
  init:fetch_loaded/0
  init:get_argument/1
  init:get_arguments/0
  init:get_plain_arguments/0
  init:notify_when_started/1
  init:objfile_extension/0
  init:run_on_load_handlers/0
  init:stop/0
  init:wait_until_started/0
  prim_eval:'receive'/2
  prim_file:advise/4
  prim_file:allocate/3
  prim_file:altname/2
  prim_file:close/1
  prim_file:copy/3
  prim_file:datasync/1
  prim_file:del_dir/2
  prim_file:delete/2
  prim_file:get_cwd/1
  prim_file:get_cwd/2
  prim_file:list_dir/2
  prim_file:list_dir_all/2
  prim_file:make_dir/2
  prim_file:make_link/3
  prim_file:make_symlink/3
  prim_file:open/2
  prim_file:position/2
  prim_file:read/2
  prim_file:read_file/1
  prim_file:read_file_info/1
  prim_file:read_file_info/2
  prim_file:read_file_info/3
  prim_file:read_link/2
  prim_file:read_link_all/2
  prim_file:read_link_info/2
  prim_file:read_link_info/3
  prim_file:rename/3
  prim_file:set_cwd/2
  prim_file:start/0
  prim_file:stop/1
  prim_file:sync/1
  prim_file:truncate/1
  prim_file:write/2
  prim_file:write_file/2
  prim_file:write_file_info/2
  prim_file:write_file_info/3
  prim_file:write_file_info/4
  prim_inet:accept/1
  prim_inet:accept/2
  prim_inet:bind/3
  prim_inet:chgopts/2
  prim_inet:close/1
  prim_inet:connect/3
  prim_inet:connect/4
  prim_inet:fdopen/4
  prim_inet:getfd/1
  prim_inet:gethostname/1
  prim_inet:getifaddrs/1
  prim_inet:getiflist/1
  prim_inet:getopt/2
  prim_inet:getopts/2
  prim_inet:getservbyname/3
  prim_inet:getservbyport/3
  prim_inet:getstat/2
  prim_inet:getstatus/1
  prim_inet:gettype/1
  prim_inet:ifget/3
  prim_inet:ifset/3
  prim_inet:ignorefd/2
  prim_inet:is_sockopt_val/2
  prim_inet:listen/2
  prim_inet:open/4
  prim_inet:peeloff/2
  prim_inet:peername/1
  prim_inet:peernames/1
  prim_inet:peernames/2
  prim_inet:recv/2
  prim_inet:recv/3
  prim_inet:recvfrom/2
  prim_inet:recvfrom/3
  prim_inet:send/2
  prim_inet:send/3
  prim_inet:sendmsg/3
  prim_inet:sendto/4
  prim_inet:setopt/3
  prim_inet:setopts/2
  prim_inet:setpeername/2
  prim_inet:setsockname/2
  prim_inet:shutdown/2
  prim_inet:sockname/1
  prim_inet:socknames/1
  prim_inet:socknames/2
  prim_inet:unrecv/2
  prim_zip:close/1
  prim_zip:open/3
  webtool:start/0
  webtool:start_tools/2
  webtool:stop/0
  webtool:stop_tools/2
  zlib:close/1
  zlib:compress/1
  zlib:crc32/1
  zlib:crc32/2
  zlib:crc32/3
  zlib:deflate/3
  zlib:deflateEnd/1
  zlib:deflateInit/6
  zlib:inflate/2
  zlib:inflateEnd/1
  zlib:inflateInit/2
  zlib:open/0
  zlib:uncompress/1
Unknown types:
  erlang:timestamp/0
 done in 2m14.22s
done (warnings were emitted)
make: [/Users/myers/p/forks/meck/.deps.plt] Error 2 (ignored)
  Checking whether the PLT /Users/myers/p/forks/meck/.deps.plt is up-to-date... yes
  Proceeding with analysis...
/Users/myers/p/forks/meck/src/meck_proc.erl:84: Invalid type specification for function meck_proc:start/2. The success typing is (atom(),[any()]) -> 'ok'
Unknown functions:
  erlang:atom_to_list/1
  erlang:erase/1
  erlang:fun_info/2
  erlang:get/1
  erlang:get_module_info/1
  erlang:get_module_info/2
  erlang:get_stacktrace/0
  erlang:integer_to_list/1
  erlang:is_builtin/3
  erlang:link/1
  erlang:list_to_atom/1
  erlang:list_to_existing_atom/1
  erlang:monitor/2
  erlang:process_flag/2
  erlang:put/2
  erlang:raise/3
  erlang:registered/0
Unknown types:
  erlang:timestamp/0
  meck_history:history_record/0
 done in 0m2.35s
done (warnings were emitted)
eproxus commented 10 years ago

@myers Do you get similar output under R16B03-1?

Also, you should probably initialize Dialyzer with something like this before you run it (the most common OTP apps):

dialyzer --build_plt --apps erts kernel stdlib crypto sasl ssl inets xmerl public_key compiler
myers commented 10 years ago

I'm jumping between three things at the moment. Here's the output with R16B03-1.

myers@badger:~/p/forks/meck$ make get-deps clean dialyzer
==> meck (get-deps)
Pulling hamcrest from {git,"https://github.com/hyperthunk/hamcrest-erlang.git",
                           {branch,"master"}}
Cloning into 'hamcrest'...
Checking connectivity... done
==> hamcrest (get-deps)
==> hamcrest (compile)
Compiled src/hamcrest_term.erl
Compiled src/hamcrest.erl
Compiled src/hamcrest_matchers.erl
==> hamcrest (post_compile)
==> meck (compile)
==> meck (clean)
==> meck (compile)
Compiled src/meck_code.erl
Compiled src/meck_args_matcher.erl
Compiled src/meck_cover.erl
Compiled src/meck_code_gen.erl
Compiled src/meck_expect.erl
Compiled src/meck_matcher.erl
Compiled src/meck_history.erl
Compiled src/meck.erl
Compiled src/meck_util.erl
Compiled src/meck_ret_spec.erl
Compiled src/meck_proc.erl
dialyzer --build_plt --apps kernel stdlib eunit tools compiler -r deps --output_plt /Users/myers/p/forks/meck/.deps.plt
  Compiling some key modules to native code... done in 0m43.13s
  Creating PLT /Users/myers/p/forks/meck/.deps.plt ...
eunit_test.erl:305: Call to missing or unexported function eunit_test:nonexisting_function/0
Unknown functions:
  crypto:block_decrypt/4
  crypto:block_encrypt/4
  crypto:start/0
  dbg:trace_client/3
  dbg:trace_port/2
  erl_prim_loader:get_cwd/0
  erl_prim_loader:get_cwd/1
  erl_prim_loader:get_file/1
  erl_prim_loader:get_path/0
  erl_prim_loader:list_dir/1
  erl_prim_loader:prim_get_cwd/2
  erl_prim_loader:prim_get_file/2
  erl_prim_loader:prim_init/0
  erl_prim_loader:prim_list_dir/2
  erl_prim_loader:prim_read_file_info/2
  erl_prim_loader:read_file_info/1
  erl_prim_loader:set_primary_archive/4
  erlang:atom_to_list/1
  erlang:binary_to_list/1
  erlang:binary_to_list/3
  erlang:binary_to_term/1
  erlang:bitstring_to_list/1
  erlang:call_on_load_function/1
  erlang:cancel_timer/1
  erlang:check_old_code/1
  erlang:check_process_code/2
  erlang:date/0
  erlang:delete_module/1
  erlang:demonitor/1
  erlang:demonitor/2
  erlang:display/1
  erlang:dt_restore_tag/1
  erlang:dt_spread_tag/1
  erlang:erase/0
  erlang:erase/1
  erlang:exit/2
  erlang:external_size/1
  erlang:finish_after_on_load/2
  erlang:float_to_list/1
  erlang:fun_info/2
  erlang:fun_to_list/1
  erlang:function_exported/3
  erlang:garbage_collect/0
  erlang:garbage_collect/1
  erlang:get/0
  erlang:get/1
  erlang:get_module_info/1
  erlang:get_module_info/2
  erlang:get_stacktrace/0
  erlang:group_leader/0
  erlang:group_leader/2
  erlang:hibernate/3
  erlang:integer_to_list/1
  erlang:iolist_size/1
  erlang:iolist_to_binary/1
  erlang:is_alive/0
  erlang:is_builtin/3
  erlang:is_process_alive/1
  erlang:link/1
  erlang:list_to_atom/1
  erlang:list_to_binary/1
  erlang:list_to_bitstring/1
  erlang:list_to_existing_atom/1
  erlang:list_to_float/1
  erlang:list_to_integer/1
  erlang:list_to_integer/2
  erlang:list_to_pid/1
  erlang:list_to_tuple/1
  erlang:load_module/2
  erlang:localtime/0
  erlang:localtime_to_universaltime/1
  erlang:localtime_to_universaltime/2
  erlang:make_fun/3
  erlang:make_ref/0
  erlang:match_spec_test/3
  erlang:max/2
  erlang:md5/1
  erlang:md5_final/1
  erlang:md5_init/0
  erlang:md5_update/2
  erlang:memory/1
  erlang:min/2
  erlang:module_loaded/1
  erlang:monitor/2
  erlang:monitor_node/2
  erlang:monitor_node/3
  erlang:nodes/0
  erlang:nodes/1
  erlang:now/0
  erlang:open_port/2
  erlang:phash/2
  erlang:phash2/1
  erlang:pid_to_list/1
  erlang:port_close/1
  erlang:port_command/2
  erlang:port_connect/2
  erlang:port_control/3
  erlang:port_get_data/1
  erlang:port_info/2
  erlang:port_set_data/2
  erlang:port_to_list/1
  erlang:ports/0
  erlang:pre_loaded/0
  erlang:process_display/2
  erlang:process_flag/2
  erlang:process_info/1
  erlang:process_info/2
  erlang:processes/0
  erlang:purge_module/1
  erlang:put/2
  erlang:raise/3
  erlang:read_timer/1
  erlang:ref_to_list/1
  erlang:register/2
  erlang:registered/0
  erlang:send/3
  erlang:send_after/3
  erlang:seq_trace/2
  erlang:seq_trace_info/1
  erlang:seq_trace_print/1
  erlang:seq_trace_print/2
  erlang:setnode/2
  erlang:setnode/3
  erlang:spawn/3
  erlang:spawn_link/3
  erlang:spawn_monitor/1
  erlang:spawn_monitor/3
  erlang:spawn_opt/2
  erlang:spawn_opt/4
  erlang:spawn_opt/5
  erlang:split_binary/2
  erlang:start_timer/3
  erlang:statistics/1
  erlang:system_flag/2
  erlang:term_to_binary/1
  erlang:term_to_binary/2
  erlang:trace/3
  erlang:trace_delivered/1
  erlang:trace_info/2
  erlang:trace_pattern/3
  erlang:universaltime/0
  erlang:universaltime_to_localtime/1
  erlang:unlink/1
  erlang:unregister/1
  erlang:whereis/1
  hipe:compile/4
  httpd:parse_query/1
  init:archive_extension/0
  init:code_path_choice/0
  init:ensure_loaded/1
  init:fetch_loaded/0
  init:get_argument/1
  init:get_arguments/0
  init:get_plain_arguments/0
  init:notify_when_started/1
  init:objfile_extension/0
  init:run_on_load_handlers/0
  init:stop/0
  init:wait_until_started/0
  prim_eval:'receive'/2
  prim_file:advise/4
  prim_file:allocate/3
  prim_file:altname/2
  prim_file:close/1
  prim_file:copy/3
  prim_file:datasync/1
  prim_file:del_dir/2
  prim_file:delete/2
  prim_file:get_cwd/1
  prim_file:get_cwd/2
  prim_file:list_dir/2
  prim_file:list_dir_all/2
  prim_file:make_dir/2
  prim_file:make_link/3
  prim_file:make_symlink/3
  prim_file:open/2
  prim_file:position/2
  prim_file:read/2
  prim_file:read_file/1
  prim_file:read_file_info/1
  prim_file:read_file_info/2
  prim_file:read_file_info/3
  prim_file:read_link/2
  prim_file:read_link_all/2
  prim_file:read_link_info/2
  prim_file:read_link_info/3
  prim_file:rename/3
  prim_file:set_cwd/2
  prim_file:start/0
  prim_file:stop/1
  prim_file:sync/1
  prim_file:truncate/1
  prim_file:write/2
  prim_file:write_file/2
  prim_file:write_file_info/2
  prim_file:write_file_info/3
  prim_file:write_file_info/4
  prim_inet:accept/1
  prim_inet:accept/2
  prim_inet:bind/3
  prim_inet:chgopts/2
  prim_inet:close/1
  prim_inet:connect/3
  prim_inet:connect/4
  prim_inet:fdopen/4
  prim_inet:getfd/1
  prim_inet:gethostname/1
  prim_inet:getifaddrs/1
  prim_inet:getiflist/1
  prim_inet:getopt/2
  prim_inet:getopts/2
  prim_inet:getservbyname/3
  prim_inet:getservbyport/3
  prim_inet:getstat/2
  prim_inet:getstatus/1
  prim_inet:gettype/1
  prim_inet:ifget/3
  prim_inet:ifset/3
  prim_inet:ignorefd/2
  prim_inet:is_sockopt_val/2
  prim_inet:listen/2
  prim_inet:open/4
  prim_inet:peeloff/2
  prim_inet:peername/1
  prim_inet:peernames/1
  prim_inet:peernames/2
  prim_inet:recv/2
  prim_inet:recv/3
  prim_inet:recvfrom/2
  prim_inet:recvfrom/3
  prim_inet:send/2
  prim_inet:send/3
  prim_inet:sendmsg/3
  prim_inet:sendto/4
  prim_inet:setopt/3
  prim_inet:setopts/2
  prim_inet:setpeername/2
  prim_inet:setsockname/2
  prim_inet:shutdown/2
  prim_inet:sockname/1
  prim_inet:socknames/1
  prim_inet:socknames/2
  prim_inet:unrecv/2
  prim_zip:close/1
  prim_zip:open/3
  webtool:start/0
  webtool:start_tools/2
  webtool:stop/0
  webtool:stop_tools/2
  zlib:close/1
  zlib:compress/1
  zlib:crc32/1
  zlib:crc32/2
  zlib:crc32/3
  zlib:deflate/3
  zlib:deflateEnd/1
  zlib:deflateInit/6
  zlib:inflate/2
  zlib:inflateEnd/1
  zlib:inflateInit/2
  zlib:open/0
  zlib:uncompress/1
Unknown types:
  erlang:timestamp/0
 done in 1m33.68s
done (warnings were emitted)
make: [/Users/myers/p/forks/meck/.deps.plt] Error 2 (ignored)
  Checking whether the PLT /Users/myers/p/forks/meck/.deps.plt is up-to-date... yes
  Proceeding with analysis...
/Users/myers/p/forks/meck/src/meck_proc.erl:84: Invalid type specification for function meck_proc:start/2. The success typing is (atom(),[any()]) -> 'ok'
Unknown functions:
  erlang:atom_to_list/1
  erlang:erase/1
  erlang:fun_info/2
  erlang:get/1
  erlang:get_module_info/1
  erlang:get_module_info/2
  erlang:get_stacktrace/0
  erlang:integer_to_list/1
  erlang:is_builtin/3
  erlang:link/1
  erlang:list_to_atom/1
  erlang:list_to_existing_atom/1
  erlang:monitor/2
  erlang:process_flag/2
  erlang:put/2
  erlang:raise/3
  erlang:registered/0
Unknown types:
  erlang:timestamp/0
  meck_history:history_record/0
 done in 0m1.67s
done (warnings were emitted)
myers commented 10 years ago

I don't understand why the tests are failing in 17.0-rc1 on travis. I get the same failure locally on R16B03-1, even off the master branch

myers@badger:~/p/forks/meck.old$ make clean all
==> meck.old (clean)
==> meck.old (get-deps)
Pulling hamcrest from {git,"https://github.com/hyperthunk/hamcrest-erlang.git",
                           {branch,"master"}}
Cloning into 'hamcrest'...
Checking connectivity... done
==> hamcrest (get-deps)
==> hamcrest (compile)
Compiled src/hamcrest_term.erl
Compiled src/hamcrest.erl
Compiled src/hamcrest_matchers.erl
==> hamcrest (post_compile)
==> meck.old (compile)
Compiled src/meck_args_matcher.erl
Compiled src/meck_code.erl
Compiled src/meck_cover.erl
Compiled src/meck_code_gen.erl
Compiled src/meck_expect.erl
Compiled src/meck_matcher.erl
Compiled src/meck_history.erl
Compiled src/meck.erl
Compiled src/meck_util.erl
Compiled src/meck_ret_spec.erl
Compiled src/meck_proc.erl
==> meck.old (compile)
==> meck.old (eunit)
Compiled test/meck_history_tests.erl
Compiled test/meck_args_matcher_tests.erl
Compiled test/meck_expect_tests.erl
Compiled test/meck_performance_test.erl
Compiled test/meck_test_module.erl
Compiled test/meck_matcher_tests.erl
Compiled test/meck_ret_spec_tests.erl
Compiled src/meck_args_matcher.erl
Compiled src/meck_code.erl
Compiled src/meck_code_gen.erl
Compiled src/meck_cover.erl
Compiled src/meck.erl
Compiled src/meck_expect.erl
Compiled src/meck_history.erl
Compiled src/meck_matcher.erl
Compiled src/meck_ret_spec.erl
Compiled src/meck_util.erl
Compiled src/meck_proc.erl
Compiled test/meck_tests.erl
meck_tests: cover_options_fail_...*failed*
in function meck_tests:'-cover_options_fail_/1-fun-1-'/2 (test/meck_tests.erl, line 1000)
in call from meck_tests:cover_options_fail_/1 (test/meck_tests.erl, line 1000)
**error:{assertEqual_failed,[{module,meck_tests},
                     {line,1000},
                     {expression,"meck_code : compile_options ( Module )"},
                     {expected,[]},
                     {value,[{i,"../test/include"},{d,'TEST',true}]}]}

=ERROR REPORT==== 13-Mar-2014::11:04:05 ===
** Generic server mymod_meck terminating
** Last message in was {'EXIT',<0.294.0>,expected_test_exit}
** When Server state == {state,mymod,any,
                               {dict,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}},
                               true,[],
                               {false,no_binary},
                               false,undefined,[]}
** Reason for termination ==
** expected_test_exit

=ERROR REPORT==== 13-Mar-2014::11:04:09 ===
Can't load module that resides in sticky dir

=ERROR REPORT==== 13-Mar-2014::11:04:10 ===
Error in process <0.1420.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,163}]},{meck_tests,'-wait_for_the_same_pattern_on_different_processes_test/0-fun-2-',0,[{file,"test/meck_tests.erl"},{line,1350}]}]}

=ERROR REPORT==== 13-Mar-2014::11:04:10 ===
Error in process <0.1428.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,163}]},{meck_tests,'-wait_for_different_patterns_on_different_processes_test/0-fun-0-',0,[{file,"test/meck_tests.erl"},{line,1371}]}]}

=======================================================
  Failed: 1.  Skipped: 0.  Passed: 156.
Cover analysis: /Users/myers/p/forks/meck.old/.eunit/index.html

Code Coverage:
meck                  : 94%
meck_args_matcher     : 100
meck_code             : 82%
meck_code_gen         : 69%
meck_cover            : 100
meck_expect           : 100
meck_history          : 95%
meck_matcher          : 83%
meck_performance_test :  0%
meck_proc             : 96%
meck_ret_spec         : 100
meck_util             : 100

Total                 : 88%
ERROR: One or more eunit tests failed.
ERROR: eunit failed while processing /Users/myers/p/forks/meck.old: rebar_abort
make: *** [test] Error 1
eproxus commented 10 years ago

Something changed in cover on R16B03-1 so that it now returns correct compile options, it seems. I'll verify this an see if I can fix it on master so you then can rebase on that fix.

eproxus commented 10 years ago

Ok, I can confirm the include compile options from cover changed in R16B03. I'll fix this on master and then you can rebase your pull request.

eproxus commented 10 years ago

This is now fixed on c6bcda6. Please try to rebase your pull request on the latest master (contains similar changes in rebar.config to your pull request, so you'll have minor merge conflicts there).

eproxus commented 10 years ago

Hmm, spoke too soon. Seems that the platform_define didn't work for me. Any advice on this? Can't seem to get it to define that macro no matter what...

myers commented 10 years ago

I rebased and got your changes to master. I looked into why platform_define didn't work. In most of the targets in the Makefile you force rebar to use test.config instead of rebar.config. I added the platform_define line to test.config in a recent commit.

Also tests are still failing with the same error

**error:{assertEqual_failed,[{module,meck_tests},
                     {line,1000},
                     {expression,"meck_code : compile_options ( Module )"},
                     {expected,[]},
                     {value,[{i,"../test/include"},{d,'TEST',true}]}]}
eproxus commented 10 years ago

Ah, that was it, thanks! The new master should build now (Travis lags behind a bit), if not, let me know.

Also, while you're rebasing, could you clean up the commit messages (Proper capitalization and only 50-60 character summary on the first line)? :smile:

myers commented 10 years ago

So, I had to fix the regex you used for cover_empty_compile_opts and changed how you used it. Took a while tinkering with the regex to get it right.

The project builds, docs build, and test pass on my laptop with 17.0-rc2, R16B03-1, and R16B.

I have edited the commit messages as you asked.

myers commented 10 years ago

Erlang 17.0-rc1 really throws a spanner in the works. Under 17.0-rc2 erlang:system_info(otp_release) returns "17.0-rc2". But then under 17.0-rc1 erlang:system_info(otp_release) returns "17". :angry:

I propose this: remove 17.0-rc1 for travis-ci. Add 17.0 when the final release is out. Maybe add to the README.md that 17.0-rc1 is unsupported.

Also the R14B04 travis build is not working because the rebar binary uses an opcode it doesn't support:

beam/beam_load.c(1365): Error loading module rebar:

use of opcode 153; this emulator supports only up to 152

I'm going to remove that one as well.

eproxus commented 10 years ago

Thanks, great work! Didn't see that my regex was broken.

I agree, let's wait with 17.0 until it is released. The RCs are usually obsolete once the final version is out. And I think it makes sense to remove R14 support for now (Meck most likely works, it just wont be tested regurlarly). The only other solution would be to compile a new rebar with an old OTP version (which someone can do if they really need to).

edgurgel commented 10 years ago

Hey, can we get a new release? I'm using the current master and it's working perfectly :)

eproxus commented 10 years ago

@edgurgel Done, you can find it here: https://github.com/eproxus/meck/releases/tag/0.8.2

edgurgel commented 10 years ago

@eproxus Thanks! :+1: