#event{name = start_logging, data = LogDir}
-
LogDir = string(), top-level log directory for the test run.
This event indicates that the logging process of Common Test
has started successfully and is ready to receive I/O
messages.
#event{name = stop_logging, data = []}
-
This event indicates that the logging process of Common Test
was shut down at the end of the test run.
#event{name = test_start, data = {StartTime,LogDir}}
-
StartTime = {date(),time()}, test run start date and time.
LogDir = string(), top-level log directory for the test run.
This event indicates that Common Test has finished initial preparations
and begins executing test cases.
#event{name = test_done, data = EndTime}
-
EndTime = {date(),time()}, date and time the test run finished.
This event indicates that the last test case has been executed and
Common Test is shutting down.
#event{name = start_info, data = {Tests,Suites,Cases}}
-
Tests = integer(), number of tests.
Suites = integer(), total number of suites.
Cases = integer() | unknown, total number of test cases.
This event gives initial test run information that can be interpreted as:
"This test run will execute Tests separate tests, in total containing
Cases number of test cases, in Suites number of suites".
However, if a test case group with a repeat property exists in any test,
the total number of test cases cannot be calculated (unknown).
#event{name = tc_start, data = {Suite,FuncOrGroup}}
-
Suite = atom(), name of the test suite.
FuncOrGroup = Func | {Conf,GroupName,GroupProperties}
Func = atom(), name of test case or configuration function.
Conf = init_per_group | end_per_group, group configuration function.
GroupName = atom(), name of the group.
GroupProperties = list(), list of execution properties for the group.
This event informs about the start of a test case, or a group configuration
function. The event is sent also for init_per_suite and end_per_suite,
but not for init_per_testcase and end_per_testcase. If a group
configuration function starts, the group name and execution properties
are also specified.
#event{name = tc_logfile, data = {{Suite,Func},LogFileName}}
-
Suite = atom(), name of the test suite.
Func = atom(), name of test case or configuration function.
LogFileName = string(), full name of the test case log file.
This event is sent at the start of each test case (and configuration function
except init/end_per_testcase) and carries information about the
full name (that is, the file name including the absolute directory path) of
the current test case log file.
#event{name = tc_done, data = {Suite,FuncOrGroup,Result}}
-
Suite = atom(), name of the suite.
FuncOrGroup = Func | {Conf,GroupName,GroupProperties}
Func = atom(), name of test case or configuration function.
Conf = init_per_group | end_per_group, group configuration function.
GroupName = unknown | atom(), name of the group
(unknown if init- or end function times out).
GroupProperties = list(), list of execution properties for the group.
Result = ok | {auto_skipped,SkipReason} | {skipped,SkipReason} | {failed,FailReason},
the result.
SkipReason = {require_failed,RequireInfo} |
{require_failed_in_suite0,RequireInfo} |
{failed,{Suite,init_per_testcase,FailInfo}} |
UserTerm,
why the case was skipped.
FailReason = {error,FailInfo} |
{error,{RunTimeError,StackTrace}} |
{timetrap_timeout,integer()} |
{failed,{Suite,end_per_testcase,FailInfo}}, reason for failure.
RequireInfo = {not_available,atom() | tuple()}, why require failed.
FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
UserTerm,
error details.
RunTimeError = term(), a runtime error, for example,
badmatch or undef.
StackTrace = list(), list of function calls preceding a runtime error.
UserTerm = term(), any data specified by user, or exit/1 information.
This event informs about the end of a test case or a configuration function (see event
tc_start for details on element FuncOrGroup). With this event
comes the final result of the function in question. It is possible to determine on the
top level of Result if the function was successful, skipped (by the user),
or if it failed.
It is also possible to dig deeper and, for example, perform pattern matching
on the various reasons for skipped or failed. Notice that {'EXIT',Reason} tuples
are translated into {error,Reason}.
Notice also that if a {failed,{Suite,end_per_testcase,FailInfo}
result is received, the test case was successful, but
end_per_testcase for the case failed.
#event{name = tc_auto_skip, data = {Suite,TestName,Reason}}
-
Suite = atom(), the name of the suite.
TestName = init_per_suite | end_per_suite |
{init_per_group,GroupName} | {end_per_group,GroupName} |
{FuncName,GroupName} | FuncName
FuncName = atom(), the name of the test case or configuration function.
GroupName = atom(), the name of the test case group.
Reason = {failed,FailReason} |
{require_failed_in_suite0,RequireInfo},
reason for auto-skipping Func.
FailReason = {Suite,ConfigFunc,FailInfo}} |
{Suite,FailedCaseInSequence}, reason for failure.
RequireInfo = {not_available,atom() | tuple()}, why require failed.
ConfigFunc = init_per_suite | init_per_group
FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
bad_return | UserTerm,
error details.
FailedCaseInSequence = atom(), the name of a case that failed in a sequence.
RunTimeError = term(), a runtime error, for example badmatch or
undef.
StackTrace = list(), list of function calls preceeding a runtime error.
UserTerm = term(), any data specified by user, or exit/1 information.
This event is sent for every test case or configuration function that Common Test
has skipped automatically because of either a failed init_per_suite or
init_per_group, a failed require in suite/0, or a failed test case
in a sequence. Notice that this event is never received as a result of a test case getting
skipped because of init_per_testcase failing, as that information is carried with
event tc_done. If a failed test case belongs to a test case group, the second
data element is a tuple {FuncName,GroupName}, otherwise only the function name.
#event{name = tc_user_skip, data = {Suite,TestName,Comment}}
-
Suite = atom(), the name of the suite.
TestName = init_per_suite | end_per_suite |
{init_per_group,GroupName} | {end_per_group,GroupName} |
{FuncName,GroupName} | FuncName
FuncName = atom(), the name of the test case or configuration function.
GroupName = atom(), the name of the test case group.
Comment = string(), why the test case was skipped.
This event specifies that a test case was skipped by the user.
It is only received if the skip is declared in a test specification.
Otherwise, user skip information is received as a {skipped,SkipReason}
result in event tc_done for the test case. If a skipped test case belongs
to a test case group, the second data element is a tuple {FuncName,GroupName},
otherwise only the function name.
#event{name = test_stats, data = {Ok,Failed,Skipped}}
-
Ok = integer(), current number of successful test cases.
Failed = integer(), current number of failed test cases.
Skipped = {UserSkipped,AutoSkipped}
UserSkipped = integer(), current number of user-skipped test cases.
AutoSkipped = integer(), current number of auto-skipped test cases.
This is a statistics event with current count of successful, skipped,
and failed test cases so far. This event is sent after the end of each test case,
immediately following event tc_done.