From 49a45620c2c0431583969192fbefe44ee6f7850c Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 18 Sep 2012 15:51:47 -0700 Subject: make sure errors carry the name of the module that created them This allows errors to be printed at the source --- test/rclt_command_SUITE.erl | 8 ++++---- test/rclt_discover_SUITE.erl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/rclt_command_SUITE.erl b/test/rclt_command_SUITE.erl index 5adf54a..fa4fc23 100644 --- a/test/rclt_command_SUITE.erl +++ b/test/rclt_command_SUITE.erl @@ -79,7 +79,7 @@ lib_fail_case(Config) -> ok = rcl_util:mkdir_p(Lib1), CmdLine = ["-l", Lib1, "-l", Lib2], - ?assertMatch({error, {not_directory, Lib2}}, + ?assertMatch({error, {_, {not_directory, Lib2}}}, rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). @@ -91,17 +91,17 @@ output_fail_case(Config) -> CanNotCreate = filename:join([UnwritableDir, "out-dir-should-not-create"]), CmdLine = ["-o", CanNotCreate], - ?assertMatch({error, {unable_to_create_output_dir, CanNotCreate}}, + ?assertMatch({error, {_, {unable_to_create_output_dir, CanNotCreate}}}, rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). spec_parse_fail_case(_Config) -> Spec = "aaeu:3333:33.22a44", CmdLine = ["-g", Spec], - ?assertMatch({error, {failed_to_parse, _Spec}}, + ?assertMatch({error, {_, {failed_to_parse, _Spec}}}, rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). config_fail_case(_Config) -> ConfigFile = "does-not-exist", CmdLine = [ConfigFile], - ?assertMatch({error, {invalid_config_file, ConfigFile}}, + ?assertMatch({error, {_, {invalid_config_file, ConfigFile}}}, rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). diff --git a/test/rclt_discover_SUITE.erl b/test/rclt_discover_SUITE.erl index 0929e4a..63d7841 100644 --- a/test/rclt_discover_SUITE.erl +++ b/test/rclt_discover_SUITE.erl @@ -113,7 +113,7 @@ no_beam_case(Config) -> State0 = proplists:get_value(state, Config), {DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0), EbinDir = filename:join([LibDir2, BadName, "ebin"]), - ?assertMatch({error, [{no_beam_files, EbinDir}]}, + ?assertMatch({error, {_, [{no_beam_files, EbinDir}]}}, rcl_provider:do(DiscoverProvider, State1)). bad_ebin_case(Config) -> @@ -144,7 +144,7 @@ bad_ebin_case(Config) -> State0 = proplists:get_value(state, Config), {DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0), - ?assertMatch({error, [{invalid_app_file, Filename}]}, + ?assertMatch({error, {_, [{invalid_app_file, Filename}]}}, rcl_provider:do(DiscoverProvider, State1)). -- cgit v1.2.3