diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2014-12-23 22:55:25 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2014-12-23 22:55:25 -0500 |
commit | 18e50b0fa314660b24f33518621f0da898f88362 (patch) | |
tree | b549adaea827ff6c454e480fdf54fefc184e3966 /test/rebar_test_utils.erl | |
parent | cd6281043111ed9fd189dd1af1f9f8a756eb3093 (diff) | |
parent | c3a2725fc71c1c90af512499f8b277af0bb0f3cc (diff) |
Merge pull request #74 from rebar/add-compile-tests
Add release-structured compiling tests
Diffstat (limited to 'test/rebar_test_utils.erl')
-rw-r--r-- | test/rebar_test_utils.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl index 868599f..ac85f41 100644 --- a/test/rebar_test_utils.erl +++ b/test/rebar_test_utils.erl @@ -97,13 +97,19 @@ create_random_vsn() -> %%%%%%%%%%%%%%% check_results(AppDir, Expected) -> BuildDir = filename:join([AppDir, "_build", "lib"]), + Apps = rebar_app_discover:find_apps([AppDir]), + AppsNames = [{ec_cnv:to_list(rebar_app_info:name(App)), App} || App <- Apps], Deps = rebar_app_discover:find_apps([BuildDir], all), DepsNames = [{ec_cnv:to_list(rebar_app_info:name(App)), App} || App <- Deps], lists:foreach( fun({app, Name}) -> - [App] = rebar_app_discover:find_apps([AppDir]), ct:pal("Name: ~p", [Name]), - ?assertEqual(Name, ec_cnv:to_list(rebar_app_info:name(App))) + case lists:keyfind(Name, 1, AppsNames) of + false -> + error({app_not_found, Name}); + {Name, _App} -> + ok + end ; ({dep, Name}) -> ct:pal("Name: ~p", [Name]), ?assertNotEqual(false, lists:keyfind(Name, 1, DepsNames)) @@ -111,7 +117,7 @@ check_results(AppDir, Expected) -> ct:pal("Name: ~p, Vsn: ~p", [Name, Vsn]), case lists:keyfind(Name, 1, DepsNames) of false -> - error({app_not_found, Name}); + error({dep_not_found, Name}); {Name, App} -> ?assertEqual(iolist_to_binary(Vsn), iolist_to_binary(rebar_app_info:original_vsn(App))) |