From cbf20abdcb99009d9b93e34f93a9a2c55acbf958 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 18 Sep 2012 10:04:52 -0700 Subject: rcl_app_info must support comparible versions This changes moves rcl_app_info to store the version as a parsed semver rather then a string, making it comparable. tmp app info --- test/rclt_discover_SUITE.erl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'test/rclt_discover_SUITE.erl') diff --git a/test/rclt_discover_SUITE.erl b/test/rclt_discover_SUITE.erl index dca683a..0929e4a 100644 --- a/test/rclt_discover_SUITE.erl +++ b/test/rclt_discover_SUITE.erl @@ -58,7 +58,7 @@ all() -> normal_case(Config) -> LibDir1 = proplists:get_value(lib1, Config), Apps1 = [(fun({Name, Vsn}) -> - create_app(LibDir1, Name, Vsn) + create_app(LibDir1, Name, Vsn) end)(App) || App <- @@ -113,7 +113,6 @@ no_beam_case(Config) -> State0 = proplists:get_value(state, Config), {DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0), EbinDir = filename:join([LibDir2, BadName, "ebin"]), - %% Ignore apps that do not contain any beam files ?assertMatch({error, [{no_beam_files, EbinDir}]}, rcl_provider:do(DiscoverProvider, State1)). @@ -145,20 +144,20 @@ bad_ebin_case(Config) -> State0 = proplists:get_value(state, Config), {DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0), - %% Ignore apps that do not contain any beam files ?assertMatch({error, [{invalid_app_file, Filename}]}, rcl_provider:do(DiscoverProvider, State1)). - -%%% API +%%%=================================================================== +%%% Helper functions %%%=================================================================== create_app(Dir, Name, Vsn) -> AppDir = filename:join([Dir, Name]), write_app_file(AppDir, Name, Vsn), write_beam_file(AppDir, Name), - rcl_app_info:new(erlang:list_to_atom(Name), Vsn, AppDir, - [kernel, stdlib], []). + {ok, App} = rcl_app_info:new(erlang:list_to_atom(Name), Vsn, AppDir, + [kernel, stdlib], []), + App. write_beam_file(Dir, Name) -> Beam = filename:join([Dir, "ebin", "not_a_real_beam" ++ Name ++ ".beam"]), -- cgit v1.2.3