Skip to content

Commit

Permalink
Tweak common_test_app.xml (and fix some issue while at it)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira committed Oct 14, 2020
1 parent 4bbdbf8 commit 57f3963
Showing 1 changed file with 80 additions and 78 deletions.
158 changes: 80 additions & 78 deletions lib/common_test/doc/src/common_test_app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@

<funcs>
<func>
<name>Module:all() -> Tests | {skip,Reason} </name>
<name>Module:all() -> [TestDef] | {skip, Reason}</name>
<fsummary>Returns the list of all test case groups and test cases
in the module.</fsummary>
<type>
<v>Tests = [TestCase | {group,GroupName} | {group,GroupName,Properties} | {group,GroupName,Properties,SubGroups}]</v>
<v>TestDef = TestCase | {group, GroupName} | {group, GroupName, Properties} | {group, GroupName, Properties, SubGroups}</v>
<v>TestCase = atom()</v>
<v>GroupName = atom()</v>
<v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}] | default</v>
<v>SubGroups = [{GroupName,Properties} | {GroupName,Properties,SubGroups}]</v>
<v>Shuffle = shuffle | {shuffle,Seed}</v>
<v>Seed = {integer(),integer(),integer()}</v>
<v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail</v>
<v>N = integer() | forever</v>
<v>Properties = [parallel | sequence | Shuffle | {RepeatType, N}] | default</v>
<v>SubGroups = [{GroupName, Properties} | {GroupName, Properties, SubGroups}]</v>
<v>Shuffle = shuffle | {shuffle, Seed}</v>
<v>Seed = {integer(), integer(), integer()}</v>
<v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail</v>
<v>N = integer() | forever</v>
<v>Reason = term()</v>
</type>

Expand All @@ -103,7 +103,7 @@
(With value <c>default</c>, the group definition properties
are used).</p>

<p>If <c>{skip,Reason}</c> is returned, all test cases
<p>If <c>{skip, Reason}</c> is returned, all test cases
in the module are skipped and <c>Reason</c>
is printed on the HTML result page.</p>

Expand All @@ -115,17 +115,16 @@
</func>

<func>
<name>Module:groups() -> GroupDefs</name>
<name>Module:groups() -> [GroupDef]</name>
<fsummary>Returns a list of test case group definitions.</fsummary>
<type>
<v>GroupDefs = [Group]</v>
<v>Group = {GroupName,Properties,GroupsAndTestCases}</v>
<v>GroupDef = {GroupName, Properties, GroupsAndTestCases}</v>
<v>GroupName = atom()</v>
<v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}]</v>
<v>GroupsAndTestCases = [Group | {group,GroupName} | TestCase]</v>
<v>Properties = [parallel | sequence | Shuffle | {RepeatType, N}]</v>
<v>GroupsAndTestCases = [Group | {group, GroupName} | TestCase]</v>
<v>TestCase = atom()</v>
<v>Shuffle = shuffle | {shuffle,Seed}</v>
<v>Seed = {integer(),integer(),integer()}</v>
<v>Shuffle = shuffle | {shuffle, Seed}</v>
<v>Seed = {integer(), integer(), integer()}</v>
<v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail</v>
<v>N = integer() | forever</v>
</type>
Expand All @@ -140,32 +139,33 @@
</func>

<func>
<name>Module:suite() -> [Info] </name>
<name>Module:suite() -> [Info]</name>
<fsummary>Test suite info function (providing default data
for the suite).</fsummary>
<type>
<v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs}</v>
<v>Time = TimeVal | TimeFunc</v>
<v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
<v>TimeFunc = {Mod,Func,Args} | Fun</v>
<v>MilliSec = integer()</v>
<v>Mod = atom()</v>
<v>Func = atom()</v>
<v>Args = list()</v>
<v>Fun = fun()</v>
<v>Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys}</v>
<v>Key = atom()</v>
<v>SubKeys = SubKey | [SubKey]</v>
<v>SubKey = atom()</v>
<v>Name = atom()</v>
<v>UserData = term()</v>
<v>Conns = [atom()]</v>
<v>CSSFile = string()</v>
<v>CTHs = [CTHModule |</v>
<v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
<v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
<v>CTHModule = atom()</v>
<v>CTHInitArgs = term()</v>
<v>Info = {timetrap, Time} | {require, Required} | {require, Name, Required} | {userdata, UserData} | {silent_connections, Conns} | {stylesheet, CSSFile} | {ct_hooks, CTHs}</v>
<v>Time = TimeVal | TimeFunc</v>
<v>TimeVal = MilliSec | {seconds, integer()} | {minutes, integer()} | {hours, integer()}</v>
<v>TimeFunc = {Mod, Func, Args} | Fun</v>
<v>MilliSec = integer()</v>
<v>Mod = atom()</v>
<v>Func = atom()</v>
<v>Args = list()</v>
<v>Fun = fun()</v>
<v>Required = Key | {Key, SubKeys} | {Key, SubKey} | {Key, SubKey, SubKeys}</v>
<v>Key = atom()</v>
<v>SubKeys = SubKey | [SubKey]</v>
<v>SubKey = atom()</v>
<v>Name = atom()</v>
<v>UserData = term()</v>
<v>Conns = [atom()]</v>
<v>CSSFile = string()</v>
<v>CTHs = [CTHModule |</v>
<v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
<v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
<v>CTHModule = atom()</v>
<v>CTHInitArgs = term()</v>
<v>CTHPriority = integer()</v>
</type>
<desc>

Expand Down Expand Up @@ -213,11 +213,11 @@
</func>

<func>
<name>Module:init_per_suite(Config) -> NewConfig | {skip,Reason} |
{skip_and_save,Reason,SaveConfig}</name>
<name>Module:init_per_suite(Config) -> NewConfig | {skip, Reason} |
{skip_and_save, Reason, SaveConfig}</name>
<fsummary>Test suite initializations.</fsummary>
<type>
<v>Config = NewConfig = SaveConfig = [{Key,Value}]</v>
<v>Config = NewConfig = SaveConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Reason = term()</v>
Expand All @@ -236,7 +236,7 @@
function is specified as <c>Config</c> to all configuration functions
and test cases in the suite.</p>

<p>If <c>{skip,Reason}</c>
<p>If <c>{skip, Reason}</c>
is returned, all test cases in the suite are skipped
and <c>Reason</c> is printed in the overview log for the suite.</p>

Expand All @@ -248,11 +248,11 @@
</func>

<func>
<name>Module:end_per_suite(Config) -> term() |
{save_config,SaveConfig}</name>
<name>Module:end_per_suite(Config) -> term() |
{save_config, SaveConfig}</name>
<fsummary>Test suite finalization.</fsummary>
<type>
<v>Config = SaveConfig = [{Key,Value}]</v>
<v>Config = SaveConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
</type>
Expand All @@ -272,21 +272,22 @@
</func>

<func>
<name>Module:group(GroupName) -> [Info] </name>
<name>Module:group(GroupName) -> [Info]</name>
<fsummary>Test case group information function (providing default data
for a test case group, that is, its test cases and
subgroups).</fsummary>
<type>
<v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs}</v>
<v>GroupName = atom()</v>
<v>Info = {timetrap, Time} | {require, Required} | {require, Name, Required} | {userdata, UserData} | {silent_connections, Conns} | {stylesheet, CSSFile} | {ct_hooks, CTHs}</v>
<v>Time = TimeVal | TimeFunc</v>
<v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
<v>TimeFunc = {Mod,Func,Args} | Fun</v>
<v>TimeVal = MilliSec | {seconds, integer()} | {minutes, integer()} | {hours, integer()}</v>
<v>TimeFunc = {Mod, Func, Args} | Fun</v>
<v>MilliSec = integer()</v>
<v>Mod = atom()</v>
<v>Func = atom()</v>
<v>Args = list()</v>
<v>Fun = fun()</v>
<v>Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
<v>Required = Key | {Key, SubKeys} | {Key, SubKey} | {Key, SubKey, SubKeys}</v>
<v>Key = atom()</v>
<v>SubKeys = SubKey | [SubKey]</v>
<v>SubKey = atom()</v>
Expand All @@ -299,6 +300,7 @@
<v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
<v>CTHModule = atom()</v>
<v>CTHInitArgs = term()</v>
<v>CTHPriority = integer()</v>
</type>
<desc>

Expand Down Expand Up @@ -353,11 +355,11 @@

<func>
<name>Module:init_per_group(GroupName, Config) -> NewConfig |
{skip,Reason}</name>
{skip, Reason}</name>
<fsummary>Test case group initializations.</fsummary>
<type>
<v>GroupName = atom()</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>Config = NewConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Reason = term()</v>
Expand All @@ -379,7 +381,7 @@
The return value of this function is given as <c>Config</c>
to all test cases and subgroups in the group.</p>

<p>If <c>{skip,Reason}</c>
<p>If <c>{skip, Reason}</c>
is returned, all test cases in the group are skipped and
<c>Reason</c> is printed in the overview log for the group.</p>

Expand All @@ -391,11 +393,11 @@

<func>
<name>Module:end_per_group(GroupName, Config) -> term() |
{return_group_result,Status}</name>
{return_group_result, Status}</name>
<fsummary>Test case group finalization.</fsummary>
<type>
<v>GroupName = atom()</v>
<v>Config = [{Key,Value}]</v>
<v>Config = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Status = ok | skipped | failed</v>
Expand All @@ -410,7 +412,7 @@
is finished. It is meant to be used for cleaning up after
<seealso marker="#Module:init_per_group-2"><c>init_per_group/2</c></seealso>.
A status value for a nested subgroup can be returned with
<c>{return_group_result,Status}</c>. The status can be retrieved in
<c>{return_group_result, Status}</c>. The status can be retrieved in
<seealso marker="#Module:end_per_group-2"><c>end_per_group/2</c></seealso>
for the group on the level above. The status is also used by
<c>Common Test</c> for deciding if execution of a group is to
Expand All @@ -424,14 +426,14 @@
</func>

<func>
<name>Module:init_per_testcase(TestCase, Config) -> NewConfig | {fail,Reason} | {skip,Reason}</name>
<name>Module:init_per_testcase(TestCase, Config) -> NewConfig | {fail, Reason} | {skip, Reason}</name>
<fsummary>Test case initializations.</fsummary>
<type>
<v> TestCase = atom()</v>
<v> Config = NewConfig = [{Key,Value}]</v>
<v> Key = atom()</v>
<v> Value = term()</v>
<v> Reason = term()</v>
<v>TestCase = atom()</v>
<v>Config = NewConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Reason = term()</v>
</type>
<desc>

Expand All @@ -445,20 +447,20 @@
<c>Config</c> (list of key-value tuples) is the configuration
data that can be modified. The <c>NewConfig</c> list returned
from this function is given as <c>Config</c> to the test case.
If <c>{fail,Reason}</c> is returned, the test case is
If <c>{fail, Reason}</c> is returned, the test case is
marked as failed without being executed.</p>

<p>If <c>{skip,Reason}</c> is returned, the test case is skipped
<p>If <c>{skip, Reason}</c> is returned, the test case is skipped
and <c>Reason</c> is printed in the overview log for the suite.</p>
</desc>
</func>

<func>
<name>Module:end_per_testcase(TestCase, Config) -> term() | {fail,Reason} | {save_config,SaveConfig}</name>
<name>Module:end_per_testcase(TestCase, Config) -> term() | {fail, Reason} | {save_config, SaveConfig}</name>
<fsummary>Test case finalization.</fsummary>
<type>
<v>TestCase = atom()</v>
<v>Config = SaveConfig = [{Key,Value}]</v>
<v>Config = SaveConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Reason = term()</v>
Expand All @@ -473,9 +475,9 @@
<p>This function is called after each test case, and can be used
to clean up after
<seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
and the test case. Any return value (besides <c>{fail,Reason}</c>
and <c>{save_config,SaveConfig}</c>) is ignored. By returning
<c>{fail,Reason}</c>, <c>TestCase</c> is marked as faulty (even
and the test case. Any return value (besides <c>{fail, Reason}</c>
and <c>{save_config, SaveConfig}</c>) is ignored. By returning
<c>{fail, Reason}</c>, <c>TestCase</c> is marked as faulty (even
though it was successful in the sense that it returned
a value instead of terminating).</p>

Expand All @@ -489,16 +491,16 @@
<name>Module:Testcase() -> [Info] </name>
<fsummary>Test case information function.</fsummary>
<type>
<v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns}</v>
<v>Info = {timetrap, Time} | {require, Required} | {require, Name, Required} | {userdata, UserData} | {silent_connections, Conns}</v>
<v>Time = TimeVal | TimeFunc</v>
<v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
<v>TimeFunc = {Mod,Func,Args} | Fun</v>
<v>TimeVal = MilliSec | {seconds, integer()} | {minutes, integer()} | {hours, integer()}</v>
<v>TimeFunc = {Mod, Func, Args} | Fun</v>
<v>MilliSec = integer()</v>
<v>Mod = atom()</v>
<v>Func = atom()</v>
<v>Args = list()</v>
<v>Fun = fun()</v>
<v>Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
<v>Required = Key | {Key, SubKeys} | {Key, SubKey} | {Key, SubKey, SubKeys}</v>
<v>Key = atom()</v>
<v>SubKeys = SubKey | [SubKey]</v>
<v>SubKey = atom()</v>
Expand Down Expand Up @@ -560,10 +562,10 @@
</func>

<func>
<name>Module:Testcase(Config) -> term() | {skip,Reason} | {comment,Comment} | {save_config,SaveConfig} | {skip_and_save,Reason,SaveConfig} | exit() </name>
<name>Module:Testcase(Config) -> term() | {skip, Reason} | {comment, Comment} | {save_config, SaveConfig} | {skip_and_save, Reason, SaveConfig} | exit()</name>
<fsummary>A test case.</fsummary>
<type>
<v>Config = SaveConfig = [{Key,Value}]</v>
<v>Config = SaveConfig = [{Key, Value}]</v>
<v>Key = atom()</v>
<v>Value = term()</v>
<v>Reason = term()</v>
Expand All @@ -584,11 +586,11 @@
(or the macro <c>?config</c> defined in <c>ct.hrl</c>).</p>

<p>If you decide not to run the test case after all, return
<c>{skip,Reason}</c>. <c>Reason</c> is then
<c>{skip, Reason}</c>. <c>Reason</c> is then
printed in field <c>Comment</c> on the HTML result page.</p>

<p>To print some information in field <c>Comment</c> on the HTML
result page, return <c>{comment,Comment}</c>.</p>
result page, return <c>{comment, Comment}</c>.</p>

<p>If the function returns anything else, the test case is
considered successful. The return value always gets printed
Expand Down

0 comments on commit 57f3963

Please sign in to comment.