Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few test cases for sys_config CT option #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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: 2 additions & 0 deletions ct_sys_config/config/ct.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[{acme,
[{answer, 42}]}].
10 changes: 10 additions & 0 deletions ct_sys_config/ct_sys_config.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TERM=dumb rebar3 ct
>>> /All 1 tests passed/
>>>= 0

TERM=dumb rebar3 do eunit, ct
>>> /All 1 tests passed/
>>>= 0

TERM=dumb rebar3 do ct, ct
>>>= 0
2 changes: 2 additions & 0 deletions ct_sys_config/rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ct_opts,
[{sys_config, "config/ct.config"}]}.
1 change: 1 addition & 0 deletions ct_sys_config/rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[].
4 changes: 4 additions & 0 deletions ct_sys_config/src/acme.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{application, acme,
[{description, "ACME"},
{vsn, "0.1.0"},
{applications, [kernel, stdlib]}]}.
17 changes: 17 additions & 0 deletions ct_sys_config/test/acme_SUITE.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-module(acme_SUITE).
-compile([export_all, nowarn_export_all]).

all() ->
[test_env].

test_env(_Config) ->
false = lists:keyfind(acme, 1, application:loaded_applications()),
{ok, 42} = application:get_env(acme, answer),

ok = application:load(acme),
{ok, 42} = application:get_env(acme, answer),

ok = application:unload(acme),
undefined = application:get_env(acme, answer),

ok.