The
Common Test is such a framework, well suited for automated black box testing of target systems of any kind (not necessarily implemented in Erlang). Common Test is also a very useful tool for white box testing Erlang programs and OTP applications. Please see the Common Test User's Guide and reference manual for more information.
If you want to write your own framework, some more information
can be found in the chapter "Writing your own test server
framework" in the Test Server User's Guide. Details about the
interface provided by
This function starts the test server.
This stops the test server and all its activity. The running test suite (if any) will be halted.
Puts a collection of suites matching (*_SUITE) in given
directories into the job queue.
This function adds a module or a list of modules, to the
test servers job queue.
This function will add one test case to the job queue. The job will be given the module's name.
Equivalent to
This function will add one or more test cases to the job queue. The job will be given the module's name.
Equivalent to
This function will add the content of the given test
specification file to the job queue. The job will be given the
name of the test specification file, e.g. if the file is
called
See the reference manual for the test server application for details about the test specification file.
These functions add test jobs just like the add_dir, add_module, add_case and add_cases functions above, but carry an additional argument, Skip. Skip is a list of items that should be skipped in the current test run. Test job items that occur in the Skip list will be logged as SKIPPED with the associated Comment.
This function adds various test jobs to the test_server_ctrl job queue. These jobs can be of different type (all or specific suites in one directory, all or specific cases in one suite, etc). It is also possible to get particular items skipped by passing them along in the Skip list (see the add_*_with_skip functions above).
When calling this function, the currently executing test case will be aborted. It is the user's responsibility to know for sure which test case is currently executing. The function is therefore only safe to call from a function which has been called (or synchronously invoked) by the test case.
Determines where I/O from test suites/test server will
go. All text output from test suites and the test server is
tagged with a priority value which ranges from 0 to 100, 100
being the most detailed. (see the section about log files in
the user's guide). Output from the test cases (using
All output with detail level:
To view the currently set thresholds, use the
Returns the current levels. See
This function will return all the jobs currently in the job queue.
This function should be called before a test is started
which requires extended timetraps, e.g. if extensive tracing
is used. All timetraps started after this call will be
multiplied by
This function should be called before a test is started. The parameter specifies if test_server should attempt to automatically scale the timetrap value in order to compensate for delays caused by e.g. the cover tool.
This function may be called to read the values set by
This function informs the test_server controller that next test shall run with code coverage analysis. All timetraps will automatically be multiplied by 10 when cover i run.
A
{exclude, all | ExcludeModuleList}.
{include, IncludeModuleList}.
{cross, CrossCoverInfo}.
Note that each line must end with a full
stop.
If both an
If a
If the test following this call starts any slave or peer
nodes with
When the test is finished, the coverage analysis is
automatically completed, logs are created and the cover
compiled modules are unloaded. If another test is to be run
with coverage analysis,
Analyse cover data collected from multiple tests. The modules
analysed are the ones listed in
This function should be run after all tests are completed,
and the result will be stored in a file called
Note that the function can be executed on any node, and it
does not require
The
{cross,[{Tag,Modules}]}.
where
Example:
If the module
s1.cover:
{include,[m1]}.
s2.cover:
{include,[....]}. % modules belonging to system s2
{cross,[{s1,[m1]}]}.
When the tests for both
test_server_ctrl:cross_cover_analyse(Level,[{s1,S1LogDir},{s2,S2LogDir}])
and the accumulated cover data for
Note that the
The Tag in the
This function starts call trace on target and on slave or peer nodes that are started or will be started by the test suites.
Timetraps are not extended automatically when tracing is
used. Use
Note that the trace support in the test server is in a very early stage of the implementation, and thus not yet as powerful as one might wish for.
The trace information file specified by the
The trace result will be logged in a (binary) file called
This function stops tracing on target, and on slave or peer nodes that are currently running. New slave or peer nodes will no longer be traced after this.
The following functions are supposed to be invoked from the
command line using the
This function is supposed to be invoked from the commandline. It starts the test server, interprets the argument supplied from the commandline, runs the tests specified and when all tests are done, stops the test server and returns to the Erlang prompt.
The
Under a UNIX command prompt, this function can be invoked like this:
Or make an alias (this is for unix/tcsh)
And then use it like this
The valid command line flags are
A test server framework can be defined by setting the
environment variable
This function is called before a test case is started. The
purpose is to retrieve a list of subcases. The default
behaviour of this function should be to call
This function is called before a test case or configuration
function starts. It is called on the process executing the function
By returning
To fail
This function is called when a test case, or a configuration function,
is finished. It is normally called on the process where the function
Typical use of the
If
It is possible with
This function is called in order to keep the framework up-to-date with the progress of the test. This is useful e.g. if the framework implements a GUI where the progress information is constantly updated. The following can be reported:
Note that for a test case function that doesn't belong to a group,
This function is called as the result of function
The test server checks the number of processes and nodes
before and after the test is executed. This function is a
question to the framework if the test server should warn when
the number of processes or nodes has changed during the test
execution. If
The test server will ask the framework for information about the test target system and print InfoStr in the test case log file below the host information.