diff options
author | Daniel Widgren <daniel.widgren@gmail.com> | 2015-06-16 21:39:55 +0200 |
---|---|---|
committer | Daniel Widgren <daniel.widgren@gmail.com> | 2015-06-26 09:35:05 +0200 |
commit | 4eaa21cd274ac69f13429a63b8b7f2ed446e6870 (patch) | |
tree | c2c83f9c7689448ab2c58dfbe6c711644a7c2a35 /test | |
parent | 9e3b361095a9c108ef5f463846c8c97ce7fc57b9 (diff) |
Fixed so that release tests now pass. Got all green tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_test_utils.erl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl index 2f4d532..b210bc2 100644 --- a/test/rebar_test_utils.erl +++ b/test/rebar_test_utils.erl @@ -214,6 +214,7 @@ check_results(AppDir, Expected) -> ?assertNotEqual(false, lists:keyfind(Name, 1, DepsNames)) ; ({dep, Name, Vsn}) -> ct:pal("Dep Name: ~p, Vsn: ~p", [Name, Vsn]), + ct:pal("DepNames: ~p~n", [DepsNames]), case lists:keyfind(Name, 1, DepsNames) of false -> error({dep_not_found, Name}); @@ -273,11 +274,28 @@ check_results(AppDir, Expected) -> LibDir = filename:join([ReleaseDir, Name, "lib"]), {ok, RelLibs} = file:list_dir(LibDir), + ct:pal("RelLibs: ~p~n", [RelLibs]), IsSymLinkFun = fun(X) -> ec_file:is_symlink(filename:join(LibDir, X)) end, - DevMode = lists:all(IsSymLinkFun, RelLibs), + IsDirFun = + fun(X) -> + filelib:is_dir(filename:join([LibDir, X])) + end, + DevMode = + case os:type() of + {unix, _} -> + lists:all(IsSymLinkFun, RelLibs); + {win32, _} -> + Bool = lists:all(IsDirFun, RelLibs), + case ExpectedDevMode of + true -> + Bool; + false -> + not Bool + end + end, ?assertEqual(ExpectedDevMode, DevMode), %% throws not_found if it doesn't exist |