-
Notifications
You must be signed in to change notification settings - Fork 517
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
base: main
Are you sure you want to change the base?
add ct-suite template #2072
Conversation
@@ -0,0 +1,6 @@ | |||
{description, "Common Test suite module"}. | |||
{variables, [ | |||
{name, "myapp", "Name of the Common Test suite to create"} |
There was a problem hiding this comment.
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 ;-)
-include_lib("common_test/include/ct.hrl"). | ||
-include_lib("stdlib/include/assert.hrl"). | ||
|
||
-compile(export_all). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it even make sense to have half-minimalistic template?
By "half", I mean that in general Common Test requires all/0 to be exported, and nothing else. So minimalistic design means nothing else to be added, otherwise more extended template I suggested could serve a better job.
I would think a suite with only Based this on what I'd want to use, so yea, personal opinion. |
[]. | ||
|
||
all() -> | ||
[]. |
There was a problem hiding this comment.
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).
[]. | ||
|
||
init_per_suite(Config) -> | ||
Config. |
There was a problem hiding this comment.
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).
suite() -> | ||
[]. | ||
|
||
all() -> |
There was a problem hiding this comment.
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 👌🏼
This adds a message that can be printed after the template is applied. This is most useful in the
init-release
template I'll open a PR for soon because updating rebar.config isn't possible so it'll print out what to add to rebar.config for relx.