summaryrefslogtreecommitdiff
path: root/src/rebar_prv_eunit.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2016-11-19 16:15:43 -0500
committerFred Hebert <mononcqc@ferd.ca>2016-11-19 16:15:43 -0500
commite85cf555e24b2a4b9b8681b9028c87826a2c0ea6 (patch)
treec10cd279eacf1a2af637d42f8b2a876da991c7a3 /src/rebar_prv_eunit.erl
parentca0995b73b104964ab20ceed440aa323976cbc09 (diff)
Fix rebar3 dialyzer warnings
Some tricky changes in there but should be okay
Diffstat (limited to 'src/rebar_prv_eunit.erl')
-rw-r--r--src/rebar_prv_eunit.erl14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 82e2458..e85ab4c 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -153,7 +153,6 @@ cfg_tests(State) ->
?PRV_ERROR({badconfig, {"Value `~p' of option `~p' must be a list", {Wrong, eunit_tests}}})
end.
-select_tests(_State, _ProjectApps, {error, _} = Error, _) -> Error;
select_tests(_State, _ProjectApps, _, {error, _} = Error) -> Error;
select_tests(State, ProjectApps, [], []) -> {ok, default_tests(State, ProjectApps)};
select_tests(_State, _ProjectApps, [], Tests) -> {ok, Tests};
@@ -316,14 +315,9 @@ inject_test_dir(Opts, Dir) ->
compile({error, _} = Error) -> Error;
compile(State) ->
- case rebar_prv_compile:do(State) of
- %% successfully compiled apps
- {ok, S} ->
- ok = maybe_cover_compile(S),
- {ok, S};
- %% this should look like a compiler error, not an eunit error
- Error -> Error
- end.
+ {ok, S} = rebar_prv_compile:do(State),
+ ok = maybe_cover_compile(S),
+ {ok, S}.
validate_tests(State, {ok, Tests}) ->
gather_tests(fun(Elem) -> validate(State, Elem) end, Tests, []);
@@ -453,7 +447,7 @@ translate(State, [], {dir, Dir}) ->
translate(State, [], {file, FilePath}) ->
Dir = filename:dirname(FilePath),
File = filename:basename(FilePath),
- case rebar_file_utils:path_from_ancestor(Dir, rebar_app_info:dir(State)) of
+ case rebar_file_utils:path_from_ancestor(Dir, rebar_state:dir(State)) of
{ok, Path} -> {file, filename:join([rebar_dir:base_dir(State), "extras", Path, File])};
%% not relative, leave as is
{error, badparent} -> {file, FilePath}