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.

52 line
1.4 KiB

10 年之前
10 年之前
10 年之前
10 年之前
10 年之前
10 年之前
10 年之前
  1. -module(rebar_compile_SUITE).
  2. -export([suite/0,
  3. init_per_suite/1,
  4. end_per_suite/1,
  5. init_per_testcase/2,
  6. all/0,
  7. build_basic_app/1,
  8. build_release_apps/1]).
  9. -include_lib("common_test/include/ct.hrl").
  10. -include_lib("eunit/include/eunit.hrl").
  11. -include_lib("kernel/include/file.hrl").
  12. suite() ->
  13. [].
  14. init_per_suite(Config) ->
  15. Config.
  16. end_per_suite(_Config) ->
  17. ok.
  18. init_per_testcase(_, Config) ->
  19. rebar_test_utils:init_rebar_state(Config).
  20. all() ->
  21. [build_basic_app, build_release_apps].
  22. build_basic_app(Config) ->
  23. AppDir = ?config(apps, Config),
  24. Name = rebar_test_utils:create_random_name("app1_"),
  25. Vsn = rebar_test_utils:create_random_vsn(),
  26. rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]),
  27. rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}).
  28. build_release_apps(Config) ->
  29. AppDir = ?config(apps, Config),
  30. Name1 = rebar_test_utils:create_random_name("app1_"),
  31. Vsn1 = rebar_test_utils:create_random_vsn(),
  32. rebar_test_utils:create_app(filename:join([AppDir,Name1]), Name1, Vsn1, [kernel, stdlib]),
  33. Name2 = rebar_test_utils:create_random_name("app2_"),
  34. Vsn2 = rebar_test_utils:create_random_vsn(),
  35. rebar_test_utils:create_app(filename:join([AppDir,Name2]), Name2, Vsn2, [kernel, stdlib]),
  36. rebar_test_utils:run_and_check(
  37. Config, [], ["compile"],
  38. {ok, [{app, Name1}, {app, Name2}]}
  39. ).