Types
SuiteName = atom()
Return = NewReturn = Tests | {skip,Reason}
Tests = [TestCase | {testcase,TestCase,TCRepeatProps} | {group,GroupName} | {group,GroupName,Properties} | {group,GroupName,Properties,SubGroups}]
TestCase = atom()
TCRepeatProps = [{repeat,N} | {repeat_until_ok,N} | {repeat_until_fail,N}]
GroupName = atom()
Properties = GroupProperties | default
SubGroups = [{GroupName,Properties} | {GroupName,Properties,SubGroups}]
Shuffle = shuffle | {shuffle,Seed}
Seed = {integer(),integer(),integer()}
GroupRepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail
N = integer() | forever
GroupDefs = NewGroupDefs = [Group]
Group = {GroupName,GroupProperties,GroupsAndTestCases}
GroupProperties = [parallel | sequence | Shuffle | {GroupRepeatType,N}]
GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
Reason = term()
OPTIONAL
This function is called after
all/0.
It is used to modify the set of test cases and test group to
be executed, for instance to add or remove test cases and
groups, change group properties, or even skip all tests in
the suite.
Return is what
all/0
returned, that is, a list of test cases and groups to be
executed, or a tuple {skip,Reason}.
GroupDefs is what
groups/0
or the post_groups/2 hook returned, that is, a list
of group definitions.
NewReturn is the possibly modified version of Return.
This function is called only if the CTH is added before
init_per_suite is run. For details, see section
CTH Scope
in the User's Guide.
Notice that for CTHs that are installed by means of the
suite/0
function, post_all/2 is called before
the init/2
hook function. However, for CTHs that are installed by means
of the CT start flag,
the init/2
function is called first.
Note
Prior to each test execution, Common Test does a
simulated test run in order to count test suites, groups
and cases for logging purposes. This causes
the post_all/3 hook function to always be called
twice. For this reason, side effects are best avoided in
this callback.