diff options
author | Paulo Oliveira <paulo.oliveira@miniclip.com> | 2015-08-14 01:01:41 +0100 |
---|---|---|
committer | Paulo <paulo@Paulos-MacBook-Pro.local> | 2015-08-21 00:20:01 +0100 |
commit | 69802f63120c7bc87ad94eddeb43e1285ca770f9 (patch) | |
tree | 5badd38fcf7687595f824c58f6a59ea4cdf28e25 /inttest/xref_behavior/xref_behavior_rt.erl | |
parent | 3239e746e794520f27e940293a687a2c099d0b11 (diff) | |
download | rebar-69802f63120c7bc87ad94eddeb43e1285ca770f9.tar.gz |
Allow behaviors defined inside xref_extra_path
Use case: xref'ing a module that defined behavior ranch_protocol was
exiting with
{'EXIT',{undef,[{ranch_protocol,behaviour_info, [callbacks],[]}
Diffstat (limited to 'inttest/xref_behavior/xref_behavior_rt.erl')
-rw-r--r-- | inttest/xref_behavior/xref_behavior_rt.erl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/inttest/xref_behavior/xref_behavior_rt.erl b/inttest/xref_behavior/xref_behavior_rt.erl new file mode 100644 index 0000000..8536710 --- /dev/null +++ b/inttest/xref_behavior/xref_behavior_rt.erl @@ -0,0 +1,32 @@ +-module(xref_behavior_rt). + +-export([files/0, run/1]). + +files() -> + [ + {copy, "../../rebar", "rebar"}, + {copy, "rebar.config", "rebar.config"}, + {copy, "xref_behavior.erl", "src/xref_behavior.erl"}, + {copy, "gen_xref_behavior.erl", "src/gen_xref_behavior.erl"}, + {create, "ebin/xref_behavior.app", app(xref_behavior, + [xref_behavior, + gen_xref_behavior])} + ]. + +run(_Dir) -> + {ok, _} = retest_sh:run("./rebar compile", []), + {ok, _} = retest_sh:run("./rebar xref", []), + ok. + +%% +%% Generate the contents of a simple .app file +%% +app(Name, Modules) -> + App = {application, Name, + [{description, atom_to_list(Name)}, + {vsn, "1"}, + {modules, Modules}, + {registered, []}, + {applications, [kernel, stdlib]}]}, + io_lib:format("~p.\n", [App]). + |