Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ct-suite template #2072

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions priv/templates/ct-suite.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{description, "Common Test suite module"}.
{variables, [
{name, "myapp", "Name of the Common Test suite to create"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

myapp points what served as a copy-paste source ;-)

]}.
{template, "ct_suite.erl", "test/{{name}}_SUITE.erl"}.
34 changes: 34 additions & 0 deletions priv/templates/ct_suite.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-module({{name}}_SUITE).

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

-compile(nowarn_export_all).
-compile(export_all).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite controversial discussion may start with this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you decide to keep export_all is it better to have -compile([export_all, nowarn_export_all]). instead of different directives?


suite() ->
[].

all() ->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including a dummy test would be good here 👌🏼

[].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not important, but indentation seems off here (5 v. 4).


groups() ->
[].

init_per_suite(Config) ->
Config.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and here too (3 v. 4).


end_per_suite(_Config) ->
ok.

init_per_group(_GroupName, Config) ->
Config.

end_per_group(_GroupName, _Config) ->
ok.

init_per_testcase(_Case, Config) ->
Config.

end_per_testcase(_Case, _Config) ->
ok.