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.

40 line
1.3 KiB

  1. -module(tplugins_rt).
  2. -compile(export_all).
  3. -include_lib("eunit/include/eunit.hrl").
  4. -define(COMPILE_ERROR,
  5. "ERROR: Plugin bad_plugin contains compilation errors:").
  6. files() ->
  7. [
  8. {copy, "../../rebar", "rebar"},
  9. {copy, "rebar.config", "rebar.config"},
  10. {copy, "bad.config", "bad.config"},
  11. {copy, "fish.erl", "src/fish.erl"},
  12. {copy, "test_plugin.erl", "plugins/test_plugin.erl"},
  13. {copy, "bad_plugin.erl", "bad_plugins/bad_plugin.erl"},
  14. {create, "fwibble.test", <<"fwibble">>},
  15. {create, "ebin/fish.app", app(fish, [fish])}
  16. ].
  17. run(_Dir) ->
  18. ?assertMatch({ok, _}, retest_sh:run("./rebar fwibble -v", [])),
  19. ?assertEqual(false, filelib:is_regular("fwibble.test")),
  20. Ref = retest:sh("./rebar -C bad.config -v clean", [{async, true}]),
  21. {ok, _} = retest:sh_expect(Ref, "ERROR: Plugin .*bad_plugin.erl "
  22. "contains compilation errors:.*",
  23. [{newline, any}]),
  24. ok.
  25. %%
  26. %% Generate the contents of a simple .app file
  27. %%
  28. app(Name, Modules) ->
  29. App = {application, Name,
  30. [{description, atom_to_list(Name)},
  31. {vsn, "1"},
  32. {modules, Modules},
  33. {registered, []},
  34. {applications, [kernel, stdlib]}]},
  35. io_lib:format("~p.\n", [App]).