diff options
author | Eric B Merritt <[email protected]> | 2013-04-30 16:02:36 -0700 |
---|---|---|
committer | Eric B Merritt <[email protected]> | 2013-04-30 16:02:54 -0700 |
commit | 774f1998ed6fdb643286c9296929486ce8c6a962 (patch) | |
tree | 34cd891258c86d9836437947abf32e82c980f54c /test/rclt_command_SUITE.erl | |
parent | d2698281ff1b0a46b2bcf6c2579cc811a3f62500 (diff) | |
download | relx-774f1998ed6fdb643286c9296929486ce8c6a962.tar.gz relx-774f1998ed6fdb643286c9296929486ce8c6a962.tar.bz2 relx-774f1998ed6fdb643286c9296929486ce8c6a962.zip |
support the full range of possible arguments in the programmatic api
Diffstat (limited to 'test/rclt_command_SUITE.erl')
-rw-r--r-- | test/rclt_command_SUITE.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/rclt_command_SUITE.erl b/test/rclt_command_SUITE.erl index 9c96005..05da548 100644 --- a/test/rclt_command_SUITE.erl +++ b/test/rclt_command_SUITE.erl @@ -58,7 +58,8 @@ normal_passing_case(Config) -> RelVsn = "33.222", CmdLine = ["-V", LogLevel, "-g",Goal1,"-g",Goal2, "-l", Lib1, "-l", Lib2, "-n", RelName, "-v", RelVsn, "-o", Outdir], - {ok, State} = rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine)), + {ok, {Opts, Targets}} = getopt:parse(relcool:opt_spec_list(), CmdLine), + {ok, State} = rcl_cmd_args:args2state(Opts, Targets), ?assertMatch([Lib1, Lib2], rcl_state:lib_dirs(State)), ?assertMatch(Outdir, rcl_state:output_dir(State)), @@ -77,17 +78,20 @@ lib_fail_case(Config) -> ok = rcl_util:mkdir_p(Lib1), CmdLine = ["-l", Lib1, "-l", Lib2], + {ok, {Opts, Targets}} = getopt:parse(relcool:opt_spec_list(), CmdLine), ?assertMatch({error, {_, {not_directory, Lib2}}}, - rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). + rcl_cmd_args:args2state(Opts, Targets)). spec_parse_fail_case(_Config) -> Spec = "aaeu:3333:33.22a44", CmdLine = ["-g", Spec], + {ok, {Opts, Targets}} = getopt:parse(relcool:opt_spec_list(), CmdLine), ?assertMatch({error, {_, {failed_to_parse, _Spec}}}, - rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). + rcl_cmd_args:args2state(Opts, Targets)). config_fail_case(_Config) -> ConfigFile = "does-not-exist", CmdLine = ["-c", ConfigFile], + {ok, {Opts, Targets}} = getopt:parse(relcool:opt_spec_list(), CmdLine), ?assertMatch({error, {_, {invalid_config_file, ConfigFile}}}, - rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). + rcl_cmd_args:args2state(Opts, Targets)). |