-
Notifications
You must be signed in to change notification settings - Fork 518
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
Common Test SUITE template #2070
Open
max-au
wants to merge
1
commit into
erlang:main
Choose a base branch
from
max-au:common_test_suite_template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is one of the problems we have overall with the templater. It only works from the current working directory, and we get a bit of a funny thing for umbrella releases where the tests might go in
appname/test/{{name}}_SUITE.erl
.Can you quickly check if we can allow
{{dir}}/{{name}}_SUITE.erl
as a path but withdir
configurable with a default totest
?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.
I was also going to add a feature for getting the name of the parent directory to use. I need that to complete the
init-release
template so it has a good default name. Could use the same for this.