From 96b3f1cdf435954b826be3da8de714b13910d396 Mon Sep 17 00:00:00 2001
From: Peter Andersson
- The test suite module must conform to a callback interface specified
- by the CT test server. See the
+ The test suite module must conform to a
+
It's possible in the CTH to read configuration data values
+ by calling
The CT hook functions may call any of the logging functions available
+ in the
It is only possible to hook into test function which exists in the test
- suite. So in order for a CTH to hook in before
-
Common Test will always call all available hook functions, even pre- and post
+ hooks for configuration functions that are not implemented in the suite.
+ For example,
As you've seen in the basics chapter, the test suite module implements
- callback functions (mandatory or optional) for various purposes, e.g:
+
The
It is also recommended that the
Each test suite module must export the function
The callback functions that the test suite should implement, and
+ which will be described in more detail below, are
+ all listed in the
Note that if
Before execution of a group begins, the configuration function
-
Whenever a group is executed, if
A parallel test case has a private IO server as its group leader. + (Please see the Erlang Run-Time System Application documentation for + a description of the group leader concept). The + central IO server process that handles the output from regular test + cases and configuration functions, does not respond to IO messages + during execution of parallel groups. This is important to understand + in order to avoid certain traps, like this one:
+If a process,
The data directory (
The data directory,
- The
By default, Common Test creates one central private directory
+ per test run that all test cases share. This may not always be suitable,
+ especially if the same test cases are executed multiple times during
+ a test run (e.g. if they belong to a test case group with repeat
+ property), and there's a risk that files in the private directory get
+ overwritten. Under these circumstances, it's possible to configure
+ Common Test to create one dedicated private directory per
+ test case and execution instead. This is accomplished by means of
+ the flag/option:
+
+ The first value indicates the default priv_dir behaviour, i.e.
+ one private directory created per test run. The two latter
+ values tell Common Test to generate a unique test directory name
+ per test case and execution. If the auto version is used, all
+ private directories will be created automatically. This can obviously
+ become very inefficient for test runs with many test cases and/or
+ repetitions. Therefore, in case the manual version is instead used, the
+ test case must tell Common Test to create priv_dir when it needs it.
+ It does this by calling the function
You should not depend on current working directory for
reading and writing data files since this is not portable. All
scratch files are to be written in the