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.

38 lines
1.2 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 -v", [{async, true}]),
  11. {ok, Captured} =
  12. retest:sh_expect(Ref,
  13. "DEBUG: Consult config file .*/custom.config.*",
  14. [{capture, all, list}]),
  15. {ok, Missing} =
  16. retest:sh_expect(Ref,
  17. "DEBUG: Missing deps : \\[\\{dep,bad_name,"
  18. "boo,\"\\.\",undefined\\}\\]",
  19. [{capture, all, list}]),
  20. retest_log:log(debug, "[CAPTURED]: ~s~n", [Captured]),
  21. retest_log:log(debug, "[Missing]: ~s~n", [Missing]),
  22. ok.
  23. %%
  24. %% Generate the contents of a simple .app file
  25. %%
  26. app(Name, Modules) ->
  27. App = {application, Name,
  28. [{description, atom_to_list(Name)},
  29. {vsn, "1"},
  30. {modules, Modules},
  31. {registered, []},
  32. {applications, [kernel, stdlib]}]},
  33. io_lib:format("~p.\n", [App]).