You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. -module(t_custom_config_rt).
  2. -compile(export_all).
  3. -include_lib("eunit/include/eunit.hrl").
  4. files() ->
  5. [{copy, "../../rebar", "rebar"},
  6. {copy, "custom.config", "custom.config"},
  7. {create, "ebin/custom_config.app", app(custom_config, [custom_config])}].
  8. run(Dir) ->
  9. retest_log:log(debug, "Running in Dir: ~s~n", [Dir]),
  10. Ref = retest:sh("./rebar -C custom.config check-deps -vvv",
  11. [{async, true}]),
  12. {ok, Captured} =
  13. retest:sh_expect(Ref,
  14. "DEBUG: Consult config file .*/custom.config.*",
  15. [{capture, all, list}]),
  16. {ok, Missing} =
  17. retest:sh_expect(Ref,
  18. "DEBUG: Missing deps : \\[\\{dep,bad_name,"
  19. "boo,\"\\.\",undefined,false\\}\\]",
  20. [{capture, all, list}]),
  21. retest_log:log(debug, "[CAPTURED]: ~s~n", [Captured]),
  22. retest_log:log(debug, "[Missing]: ~s~n", [Missing]),
  23. ok.
  24. %%
  25. %% Generate the contents of a simple .app file
  26. %%
  27. app(Name, Modules) ->
  28. App = {application, Name,
  29. [{description, atom_to_list(Name)},
  30. {vsn, "1"},
  31. {modules, Modules},
  32. {registered, []},
  33. {applications, [kernel, stdlib]}]},
  34. io_lib:format("~p.\n", [App]).