Skip to content

Commit

Permalink
Common Test SUITE template
Browse files Browse the repository at this point in the history
Contains boilerplate code and a few hints how Common Tests are
to be used
  • Loading branch information
max-au committed May 10, 2019
1 parent af9d208 commit b81aa63
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
53 changes: 53 additions & 0 deletions priv/templates/ct_suite.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
%%%-------------------------------------------------------------------
%% @copyright (c) {{copyright_year}} {{author_name}}
%%%-------------------------------------------------------------------

-module({{name}}_SUITE).
-author("{{author_email}}").

-include_lib("common_test/include/ct.hrl").

%% Enables ?assert() for readable output
-include_lib("stdlib/include/assert.hrl").

-compile(nowarn_export_all).
-compile(export_all).

%%%-------------------------------------------------------------------
%% Test server callbacks

suite() ->
[].

init_per_suite(Config) ->
Config.

end_per_suite(_Config) ->
ok.

init_per_group(_GroupName, Config) ->
Config.

end_per_group(_GroupName, _Config) ->
ok.

init_per_testcase(_TestCase, Config) ->
Config.

end_per_testcase(_TestCase, _Config) ->
ok.

groups() ->
[].

all() ->
[basic].

%%%-------------------------------------------------------------------
%% Test cases
basic() ->
[{doc, "Tests basic functionality"}].

basic(_Config) ->
?assert(true).

6 changes: 6 additions & 0 deletions priv/templates/ct_suite.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{description, "Common Test suite"}.
{variables, [
{name, "suite", "Name of the suite, prepended to the standard _SUITE suffix"}
]}.
{dir, "test"}.
{template, "ct_suite.erl", "test/{{name}}_SUITE.erl"}.

0 comments on commit b81aa63

Please sign in to comment.