diff options
Diffstat (limited to 'test/rebar_edoc_SUITE.erl')
-rw-r--r-- | test/rebar_edoc_SUITE.erl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/rebar_edoc_SUITE.erl b/test/rebar_edoc_SUITE.erl index fded2b0..2c4aba5 100644 --- a/test/rebar_edoc_SUITE.erl +++ b/test/rebar_edoc_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("eunit/include/eunit.hrl"). -compile(export_all). -all() -> [multiapp]. +all() -> [multiapp, error_survival]. init_per_testcase(multiapp, Config) -> application:load(rebar), @@ -16,6 +16,18 @@ init_per_testcase(multiapp, Config) -> rebar_log:init(command_line, Verbosity), State = rebar_state:new([{base_dir, filename:join([AppsDir, "_build"])} ,{root_dir, AppsDir}]), + [{apps, AppsDir}, {state, State}, {name, Name} | Config]; +init_per_testcase(error_survival, Config) -> + application:load(rebar), + DataDir = ?config(data_dir, Config), + PrivDir = ?config(priv_dir, Config), + Name = rebar_test_utils:create_random_name("error_survival"), + AppsDir = filename:join([PrivDir, rebar_test_utils:create_random_name(Name)]), + ec_file:copy(filename:join([DataDir, "bad"]), AppsDir, [recursive]), + Verbosity = rebar3:log_level(), + rebar_log:init(command_line, Verbosity), + State = rebar_state:new([{base_dir, filename:join([AppsDir, "_build"])} + ,{root_dir, AppsDir}]), [{apps, AppsDir}, {state, State}, {name, Name} | Config]. end_per_testcase(_, Config) -> @@ -42,6 +54,14 @@ multiapp(Config) -> filename:join([AppsDir, "apps", "foo", "doc", "foo.html"]), "apps/bar1/doc/bar1.html")). +error_survival(Config) -> + RebarConfig = [], + rebar_test_utils:run_and_check( + Config, RebarConfig, ["edoc"], + {error,{rebar_prv_edoc,{app_failed,"bar2"}}} + ), + ok. + file_content_matches(Path, Regex) -> case file:read_file(Path) of |