Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lhttpc.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{vsn, "1.3.0"},
{modules, []},
{registered, [lhttpc_manager]},
{applications, [kernel, stdlib, ssl, crypto]},
{applications, [kernel, stdlib, ssl, crypto, public_key]},
{mod, {lhttpc, nil}},
{env, [{connection_timeout, 300000}, {pool_size, 50}]}
]}.
Expand Down
12 changes: 9 additions & 3 deletions test/lhttpc_manager_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@
%%% Eunit setup stuff

start_app() ->
application:start(public_key),
ok = application:start(asn1),
ok = application:start(public_key),
ok = application:start(ssl),
_ = application:load(lhttpc),
case application:load(lhttpc) of
ok -> ok;
{error, {already_loaded, lhttpc}} -> ok
end,
ok = application:set_env(lhttpc, pool_size, 3),
ok = application:start(lhttpc).

stop_app(_) ->
ok = application:stop(lhttpc),
ok = application:stop(ssl).
ok = application:stop(ssl),
ok = application:stop(public_key),
ok = application:stop(asn1).

manager_test_() ->
{inorder,
Expand Down
18 changes: 11 additions & 7 deletions test/lhttpc_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,18 @@ test_no(N, Tests) ->
%%% Eunit setup stuff

start_app() ->
application:start(crypto),
application:start(public_key),
ok = application:start(ssl),
ok = lhttpc:start().

stop_app(_) ->
AppsToStart = [asn1, public_key, ssl],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't crypto required as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crypto is started by rebar. Should I bother with something like ensure_started that's backward compatible?

lists:map(fun(App) ->
ok = application:start(App)
end, AppsToStart),
ok = lhttpc:start(),
AppsToStart.

stop_app(StartedApps) ->
ok = lhttpc:stop(),
ok = application:stop(ssl).
lists:map(fun(App) ->
ok = application:stop(App)
end, lists:reverse(StartedApps)).

tcp_test_() ->
{inorder,
Expand Down