25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. -module(rebar_eunit_SUITE).
  2. -export([suite/0,
  3. init_per_suite/1,
  4. end_per_suite/1,
  5. init_per_testcase/2,
  6. all/0,
  7. test_basic_app/1,
  8. test_profile/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, "eunit_").
  20. all() ->
  21. [test_basic_app, test_profile].
  22. test_basic_app(Config) ->
  23. AppDir = ?config(apps, Config),
  24. Name = rebar_test_utils:create_random_name("basic_"),
  25. Vsn = rebar_test_utils:create_random_vsn(),
  26. rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]),
  27. RebarConfig = [{erl_opts, [{d, some_define}]}],
  28. rebar_test_utils:run_and_check(Config, RebarConfig, ["eunit"], {ok, [{app, Name}]}).
  29. test_profile(Config) ->
  30. AppDir = ?config(apps, Config),
  31. Name = rebar_test_utils:create_random_name("basic_"),
  32. Vsn = rebar_test_utils:create_random_vsn(),
  33. rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]),
  34. RebarConfig = [{erl_opts, [{d, some_define}]},
  35. {profiles, [{test, [{erl_opts, [debug_info]}]}]}],
  36. rebar_test_utils:run_and_check(Config, RebarConfig, ["as", "test", "eunit"], {ok, [{app, Name}]}).