From 02e8dc98b5327712f4ae00ac9fcf5feb1d856ba0 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Tue, 28 Aug 2012 17:38:15 +0200 Subject: Update the documentation for R15B02 OTP-10050 OTP-10069 OTP-10072 OTP-10087 OTP-9865 OTP-10049 OTP-10089 OTP-10145 OTP-9896 OTP-10135 OTP-10067 OTP-9625 OTP-10127 OTP-10172 OTP-10248 OTP-9625 OTP-10086 --- lib/common_test/doc/src/run_test_chapter.xml | 530 ++++++++++++++++++--------- 1 file changed, 363 insertions(+), 167 deletions(-) (limited to 'lib/common_test/doc/src/run_test_chapter.xml') diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 058b27d622..ea62df27cc 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -178,6 +178,8 @@ , switches off html enhancements that might not be compatible with older browsers. ]]>, makes it possible to modify aspects of the logging behaviour, see Log options below. + ]]>, sets verbosity levels + for printouts.

Directories passed to Common Test may have either relative or absolute paths.

@@ -196,60 +198,73 @@ the current working directory of the Erlang Runtime System during the test run!

-

For more information about the ct_run program, see the - Installation chapter. -

- - -
- Running tests from the Web based GUI - -

The web based GUI, VTS, is started with the ct_run - program. From the GUI you can load config files, and select - directories, suites and cases to run. You can also state the - config files, directories, suites and cases on the command line - when starting the web based GUI. -

- +

The ct_run program sets the exit status before shutting down. The following values + are defined:

- ct_run -vts - ]]> - -suite - -case ]]> + 0 indicates a successful testrun, i.e. one without failed or auto-skipped test cases. + 1 indicates that one or more test cases have failed, or have been auto-skipped. + 2 indicates that the test execution has failed because of e.g. compilation errors, an + illegal return value from an info function, etc. +

If auto-skipped test cases should not affect the exit status, you may change the default + behaviour using start flag:

+
-exit_status ignore_config
-

From the GUI you can run tests and view the result and the logs. +

For more information about the ct_run program, see the + Reference Manual and the + Installation chapter.

- -

Note that ct_run -vts will try to open the Common Test start - page in an existing web browser window or start the browser if it is - not running. Which browser should be started may be specified with - the browser start command option:

-

]]>

-

Example:

-

-

Note that the browser must run as a separate OS process or VTS will hang!

-

If no specific browser start command is specified, Firefox will - be the default browser on Unix platforms and Internet Explorer on Windows. - If Common Test fails to start a browser automatically, or 'none' is - specified as the value for -browser (i.e. -browser none), start your - favourite browser manually and type in the URL that Common Test - displays in the shell.

- +
Running tests from the Erlang shell or from an Erlang program

Common Test provides an Erlang API for running tests. The main (and most flexible) function for specifying and executing tests is called - ct:run_test/1. This function takes the same start parameters as - the ct_run program described above, only the flags are instead + ct:run_test/1. + This function takes the same start parameters as + the ct_run + program described above, only the flags are instead given as options in a list of key-value tuples. E.g. a test specified with ct_run like:

+

$ ct_run -suite ./my_SUITE -logdir ./results

is with ct:run_test/1 specified as:

1> ct:run_test([{suite,"./my_SUITE"},{logdir,"./results"}]).

-

For detailed documentation, please see the ct manual page.

+ +

The function returns the test result, represented by the tuple: + {Ok,Failed,{UserSkipped,AutoSkipped}}, where each element is an + integer. If test execution fails, the function returns the tuple: + {error,Reason}, where the term Reason explains the + failure.

+ +
+ Releasing the Erlang shell +

During execution of tests, started with + ct:run_test/1, + the Erlang shell process, controlling stdin, will remain the top + level process of the Common Test system of processes. The result + is that the Erlang shell is not available for interaction during + the test run. If this is not desirable, maybe because the shell is needed + for debugging purposes or for interaction with the SUT during test + execution, you may set the release_shell start option to + true (in the call to ct:run_test/1 or by + using the corresponding test specification term, see below). This will + make Common Test release the shell immediately after the test suite + compilation stage. To accomplish this, a test runner process + is spawned to take control of the test execution, and the effect is that + ct:run_test/1 returns the pid of this process rather than the + test result - which instead is printed to tty at the end of the test run.

+

Note that in order to use the + ct:break/1/2 and + ct:continue/0/1 functions, + release_shell must be set to true.

+
+ +

For detailed documentation about + ct:run_test/1, + please see the + ct manual page.

@@ -353,31 +368,34 @@
- Using test specifications + Test Specifications

The most flexible way to specify what to test, is to use a so called test specification. A test specification is a sequence of - Erlang terms. The terms may be declared in a text file or passed - to the test server at runtime as a list - (see run_testspec/1 in the manual page - for ct). There are two general types of terms: - configuration terms and test specification terms.

+ Erlang terms. The terms are normally declared in a text file (see + ct:run_test/1), but + may also be passed to Common Test on the form of a list (see + ct:run_testspec/1). + There are two general types of terms: configuration terms and test + specification terms.

With configuration terms it is possible to e.g. label the test run (similar to ct_run -label), evaluate arbitrary expressions - before starting a test, import configuration - data (similar to - ct_run -config/-userconfig), specify HTML log directories (similar - to - ct_run -logdir), give aliases to test nodes and test - directories (to make a specification easier to read and - maintain), enable code coverage analysis (see - the Code Coverage - Analysis chapter) and specify event_handler plugins - (see the - Event Handling chapter). There is also a term for - specifying include directories that should be passed on to the - compiler when automatic compilation is performed (similar - to ct_run -include, see above).

+ before starting the test, import configuration data (similar to + ct_run -config/-userconfig), specify the top level HTML log + directory (similar to ct_run -logdir), enable code coverage + analysis (similar to ct_run -cover), install Common Test Hooks + (similar to ct_run -ch_hooks), install event_handler plugins + (similar to ct_run -event_handler), specify include directories + that should be passed to the compiler for automatic compilation + (similar to ct_run -include), disable the auto compilation + feature (similar to ct_run -no_auto_compile), set verbosity + levels (similar to ct_run -verbosity), and more.

+

Configuration terms can be combined with ct_run start flags, + or ct:run_test/1 options. The result will for some flags/options + and terms be that the values are merged (e.g. configuration files, + include directories, verbosity levels, silent connections), and for + others that the start flags/options override the test specification + terms (e.g. log directory, label, style sheet, auto compilation).

With test specification terms it is possible to state exactly which tests should run and in which order. A test term specifies either one or more suites, one or more test case groups, or one @@ -392,11 +410,12 @@ S, is a test of all cases in S. However, if a term specifying test case X and Y in S is merged with a term specifying case Z in S, the result is a test of X, Y and Z in S. To disable this - behaviour, it is possible in test specification to set the - merge_tests term to false.

+ behaviour, i.e. to instead perform each test sequentially in a "script-like" + manner, the term merge_tests can be set to false in + the test specification.

A test term can also specify one or more test suites, groups, or test cases to be skipped. Skipped suites, groups and cases - are not executed and show up in the HTML test log files as + are not executed and show up in the HTML log files as SKIPPED.

When a test case group is specified, the resulting test executes the @@ -429,12 +448,27 @@ Testing). The node parameters in the init term are only relevant in the latter (see the Large - Scale Testing chapter for information). For details on - the event_handler term, see the + Scale Testing chapter for information). For more information + about the various terms, please see the corresponding sections in the + User's Guide, such as e.g. the + ct_run + program for an overview of available start flags + (since most flags have a corresponding configuration term), and + more detailed explanation of e.g. + Logging + (for the verbosity, stylesheet and basic_html terms), + External Configuration Data + (for the config and userconfig terms), Event - Handling chapter.

+ Handling (for the event_handler term), + Common Test Hooks + (for the ct_hooks term), etc.

Config terms:

+      {merge_tests, Bool}.
+
+      {define, Constant, Value}.
+
       {node, NodeAlias, Node}.
 
       {init, InitOptions}.
@@ -443,6 +477,15 @@
       {label, Label}.
       {label, NodeRefs, Label}.
 
+      {verbosity, VerbosityLevels}.
+      {verbosity, NodeRefs, VerbosityLevels}.
+
+      {stylesheet, CSSFile}.
+      {stylesheet, NodeRefs, CSSFile}.
+
+      {silent_connections, ConnTypes}.
+      {silent_connections, NodeRefs, ConnTypes}.
+
       {multiply_timetraps, N}.
       {multiply_timetraps, NodeRefs, N}.
 
@@ -455,19 +498,23 @@
       {include, IncludeDirs}.
       {include, NodeRefs, IncludeDirs}.
 
+      {auto_compile, Bool},
+      {auto_compile, NodeRefs, Bool},
+
       {config, ConfigFiles}.
+      {config, ConfigDir, ConfigBaseNames}.
       {config, NodeRefs, ConfigFiles}.
+      {config, NodeRefs, ConfigDir, ConfigBaseNames}.
 
       {userconfig, {CallbackModule, ConfigStrings}}.
       {userconfig, NodeRefs, {CallbackModule, ConfigStrings}}.
       
-      {alias, DirAlias, Dir}.
-
-      {merge_tests, Bool}.
-      
       {logdir, LogDir}.                                        
       {logdir, NodeRefs, LogDir}.
 
+      {logopts, LogOpts}.
+      {logopts, NodeRefs, LogOpts}.
+
       {create_priv_dir, PrivDirOption}.
       {create_priv_dir, NodeRefs, PrivDirOption}.
       
@@ -480,83 +527,176 @@
       {ct_hooks, NodeRefs, CTHModules}.
 
       {enable_builtin_hooks, Bool}.
-    
+ + {basic_html, Bool}. + {basic_html, NodeRefs, Bool}. + + {release_shell, Bool}. +

Test terms:

-      {suites, DirRef, Suites}.                                
-      {suites, NodeRefs, DirRef, Suites}.
+      {suites, Dir, Suites}.                                
+      {suites, NodeRefs, Dir, Suites}.
       
-      {groups, DirRef, Suite, Groups}.
-      {groups, NodeRefsDirRef, Suite, Groups}.
+      {groups, Dir, Suite, Groups}.
+      {groups, NodeRefs, Dir, Suite, Groups}.
 
-      {groups, DirRef, Suite, GroupSpec, {cases,Cases}}.
-      {groups, NodeRefsDirRef, Suite, GroupSpec, {cases,Cases}}.
+      {groups, Dir, Suite, GroupSpec, {cases,Cases}}.
+      {groups, NodeRefs, Dir, Suite, GroupSpec, {cases,Cases}}.
 
-      {cases, DirRef, Suite, Cases}.                           
-      {cases, NodeRefs, DirRef, Suite, Cases}.
+      {cases, Dir, Suite, Cases}.                           
+      {cases, NodeRefs, Dir, Suite, Cases}.
 
-      {skip_suites, DirRef, Suites, Comment}.
-      {skip_suites, NodeRefs, DirRef, Suites, Comment}.
+      {skip_suites, Dir, Suites, Comment}.
+      {skip_suites, NodeRefs, Dir, Suites, Comment}.
 
-      {skip_groups, DirRef, Suite, GroupNames, Comment}.
-      {skip_groups, NodeRefs, DirRef, Suite, GroupNames, Comment}.
+      {skip_groups, Dir, Suite, GroupNames, Comment}.
+      {skip_groups, NodeRefs, Dir, Suite, GroupNames, Comment}.
       
-      {skip_cases, DirRef, Suite, Cases, Comment}.
-      {skip_cases, NodeRefs, DirRef, Suite, Cases, Comment}.
-    
+ {skip_cases, Dir, Suite, Cases, Comment}. + {skip_cases, NodeRefs, Dir, Suite, Cases, Comment}. +

Types:

-      NodeAlias     = atom()
-      InitOptions   = term()
-      Node          = node()
-      NodeRef       = NodeAlias | Node | master
-      NodeRefs      = all_nodes | [NodeRef] | NodeRef
-      N             = integer()
-      Bool          = true | false
-      CoverSpecFile = string()
-      IncludeDirs   = string() | [string()]
-      ConfigFiles   = string() | [string()]
-      DirAlias      = atom()
-      Dir           = string()
-      LogDir        = string()
-      PrivDirOption = auto_per_run | auto_per_tc | manual_per_tc
-      EventHandlers = atom() | [atom()]
-      InitArgs      = [term()]
-      CTHModules    = [CTHModule | {CTHModule, CTHInitArgs} | {CTHModule, CTHInitArgs, CTHPriority}]
-      CTHModule     = atom()
-      CTHInitArgs   = term()
-      DirRef        = DirAlias | Dir
-      Suites        = atom() | [atom()] | all
-      Suite         = atom()
-      Groups        = GroupSpec | [GroupSpec] | all
-      GroupSpec     = GroupName | {GroupName,Properties} | {GroupName,Properties,GroupSpec}
-      GroupName     = atom()
-      GroupNames    = GroupName | [GroupName]
-      Cases         = atom() | [atom()] | all
-      Comment       = string() | ""
-    
-

Example:

+ Bool = true | false + Constant = atom() + Value = term() + NodeAlias = atom() + Node = node() + NodeRef = NodeAlias | Node | master + NodeRefs = all_nodes | [NodeRef] | NodeRef + InitOptions = term() + Label = atom() | string() + VerbosityLevels = integer() | [{Category,integer()}] + Category = atom() + CSSFile = string() + ConnTypes = all | [atom()] + N = integer() + CoverSpecFile = string() + IncludeDirs = string() | [string()] + ConfigFiles = string() | [string()] + ConfigDir = string() + ConfigBaseNames = string() | [string()] + CallbackModule = atom() + ConfigStrings = string() | [string()] + LogDir = string() + LogOpts = [term()] + PrivDirOption = auto_per_run | auto_per_tc | manual_per_tc + EventHandlers = atom() | [atom()] + InitArgs = [term()] + CTHModules = [CTHModule | {CTHModule, CTHInitArgs} | {CTHModule, CTHInitArgs, CTHPriority}] + CTHModule = atom() + CTHInitArgs = term() + Dir = string() + Suites = atom() | [atom()] | all + Suite = atom() + Groups = GroupSpec | [GroupSpec] | all + GroupSpec = GroupName | {GroupName,Properties} | {GroupName,Properties,GroupSpec} + GroupName = atom() + GroupNames = GroupName | [GroupName] + Cases = atom() | [atom()] | all + Comment = string() | "" + +

The difference between the config terms above, is that with + ConfigDir, ConfigBaseNames is a list of base names, + i.e. without directory paths. ConfigFiles must be full names, + including paths. E.g, these two terms have the same meaning:

-      {logdir, "/home/test/logs"}.
+      {config, ["/home/testuser/tests/config/nodeA.cfg",
+                "/home/testuser/tests/config/nodeB.cfg"]}.
+
+      {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.
+ +

Any relative paths specified in the test specification, will be + relative to the directory which contains the test specification file, if + ct_run -spec TestSpecFile ... or + ct:run:test([{spec,TestSpecFile},...]) + executes the test. The path will be relative to the top level log directory, if + ct:run:testspec(TestSpec) executes the test.

- {config, "/home/test/t1/cfg/config.cfg"}. - {config, "/home/test/t2/cfg/config.cfg"}. - {config, "/home/test/t3/cfg/config.cfg"}. +

The define term introduces a constant, which is used to + replace the name Constant with Value, wherever it's found in + the test specification. This replacement happens during an initial iteration + through the test specification. Constants may be used anywhere in the test + specification, e.g. in arbitrary lists and tuples, and even in strings + and inside the value part of other constant definitions! A constant can + also be part of a node name, but that is the only place where a constant + can be part of an atom.

+ +

For the sake of readability, the name of the constant must always + begin with an upper case letter, or a $, ?, or _. + This also means that it must always be single quoted (obviously, since + the constant name is actually an atom, not text).

+ +

The main benefit of constants is that they can be used to reduce the size + (and avoid repetition) of long strings, such as file paths. Compare these + terms:

+ +
+      %% 1a. no constant
+      {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.
+      {suites, "/home/testuser/tests/suites", all}.
       
-      {alias, t1, "/home/test/t1"}.
-      {alias, t2, "/home/test/t2"}.
-      {alias, t3, "/home/test/t3"}.
+      %% 1b. with constant
+      {define, 'TESTDIR', "/home/testuser/tests"}.
+      {config, "'TESTDIR'/config", ["nodeA.cfg","nodeB.cfg"]}.
+      {suites, "'TESTDIR'/suites", all}.
+
+      %% 2a. no constants
+      {config, [testnode@host1, testnode@host2], "../config", ["nodeA.cfg","nodeB.cfg"]}.
+      {suites, [testnode@host1, testnode@host2], "../suites", [x_SUITE, y_SUITE]}.
+
+      %% 2b. with constants
+      {define, 'NODE', testnode}.
+      {define, 'NODES', ['NODE'@host1, 'NODE'@host2]}.
+      {config, 'NODES', "../config", ["nodeA.cfg","nodeB.cfg"]}.
+      {suites, 'NODES', "../suites", [x_SUITE, y_SUITE]}.
+ +

Constants make the test specification term alias, in previous + versions of Common Test, redundant. This term has been deprecated but will + remain supported in upcoming Common Test releases. Replacing alias + terms with define is strongly recommended though! Here's an example + of such a replacement:

+ +
+      %% using the old alias term
+      {config, "/home/testuser/tests/config/nodeA.cfg"}.
+      {alias, suite_dir, "/home/testuser/tests/suites"}.
+      {groups, suite_dir, x_SUITE, group1}.
+
+      %% replacing with constants
+      {define, 'TestDir', "/home/testuser/tests"}.
+      {define, 'CfgDir', "'TestDir'/config"}.
+      {define, 'SuiteDir', "'TestDir'/suites"}.
+      {config, 'CfgDir', "nodeA.cfg"}.
+      {groups, 'SuiteDir', x_SUITE, group1}.
+ +

Actually, constants could well replace the node term too, but + this still has declarative value, mainly when used in combination + with NodeRefs == all_nodes (see types above).

+ +

Here follows a simple test specification example:

+
+      {define, 'Top', "/home/test"}.
+      {define, 'T1', "'Top'/t1"}.
+      {define, 'T2', "'Top'/t2"}.
+      {define, 'T3', "'Top'/t3"}.
+      {define, 'CfgFile', "config.cfg"}.
+
+      {logdir, "'Top'/logs"}.
       
-      {suites, t1, all}.
-      {skip_suites, t1, [t1B_SUITE,t1D_SUITE], "Not implemented"}.
-      {skip_cases, t1, t1A_SUITE, [test3,test4], "Irrelevant"}.
-      {skip_cases, t1, t1C_SUITE, [test1], "Ignore"}.
+      {config, ["'T1'/'CfgFile'", "'T2'/'CfgFile'", "'T3'/'CfgFile'"]}.
       
-      {suites, t2, [t2B_SUITE,t2C_SUITE]}.
-      {cases, t2, t2A_SUITE, [test4,test1,test7]}.
+      {suites, 'T1', all}.
+      {skip_suites, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
+      {skip_cases, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
+      {skip_cases, 'T1', t1C_SUITE, [test1], "Ignore"}.
       
-      {skip_suites, t3, all, "Not implemented"}.
-    
+ {suites, 'T2', [t2B_SUITE,t2C_SUITE]}. + {cases, 'T2', t2A_SUITE, [test4,test1,test7]}. + + {skip_suites, 'T3', all, "Not implemented"}. +

The example specifies the following:

The specified logdir directory will be used for storing @@ -564,8 +704,6 @@ date and time). The variables in the specified test system config files will be imported for the test. - Aliases are given for three test system directories. The suites in - this example are stored in "/home/test/tX/test". The first test to run includes all suites for system t1. Excluded from the test are however the t1B and t1D suites. Also test cases test3 and test4 in t1A as well as the test1 case in t1C are excluded from @@ -590,8 +728,46 @@ If ct:run_test/1 is used for starting the tests, the relaxed scanner mode is enabled by means of the tuple: {allow_user_terms,true}

+ +
+ Running tests from the Web based GUI + +

The web based GUI, VTS, is started with the + ct_run + program. From the GUI you can load config files, and select + directories, suites and cases to run. You can also state the + config files, directories, suites and cases on the command line + when starting the web based GUI. +

+ + + ct_run -vts + ]]> + -suite + -case ]]> + + +

From the GUI you can run tests and view the result and the logs. +

+ +

Note that ct_run -vts will try to open the Common Test start + page in an existing web browser window or start the browser if it is + not running. Which browser should be started may be specified with + the browser start command option:

+

]]>

+

Example:

+

+

Note that the browser must run as a separate OS process or VTS will hang!

+

If no specific browser start command is specified, Firefox will + be the default browser on Unix platforms and Internet Explorer on Windows. + If Common Test fails to start a browser automatically, or 'none' is + specified as the value for -browser (i.e. -browser none), start your + favourite browser manually and type in the URL that Common Test + displays in the shell.

+
+ Log files

As the execution of the test suites proceed, events are logged in @@ -719,17 +895,30 @@

instead of each x printed on a new line, which is the default behaviour.

+
+ + Sorting HTML table columns +

By clicking the name in the column header of any table (e.g. "Ok", "Case", "Time", etc), + the table rows are sorted in whatever order makes sense for the type of value (e.g. + numerical for "Ok" or "Time", and alphabetical for "Case"). The sorting is performed + by means of JavaScript code, automatically inserted into the HTML log files. Common Test + uses the jQuery library and the + tablesorter plugin, with customized sorting + functions, for this implementation.

+
HTML Style Sheets -

Common Test uses a CSS file to control the look of the HTML - files generated during test runs. If, for some reason, the - log files are not displayed correctly in the HTML browser of your - choice, or you prefer the "pre Common Test v1.6 look" - of the log files (i.e. not using CSS), use the start flag/option - basic_html to revert to the old style.

+

Common Test uses an HTML Style Sheet (CSS file) to control the look of + the HTML log files generated during test runs. If, for some reason, the + log files are not displayed correctly in the browser of your + choice, or you prefer a more primitive ("pre Common Test v1.6") look + of the logs, use the start flag/option:

+
basic_html
+

This disables the use of Style Sheets, as well as JavaScripts (see + table sorting above).

Common Test includes an optional feature to allow user HTML style sheets for customizing printouts. The @@ -882,75 +1071,82 @@

Silent Connections -

The protocol handling processes in Common Test, implemented by ct_telnet, ct_ftp etc, - do verbose printing to the test case logs. This can be switched off by means - of the -silent_connections flag:

+

The protocol handling processes in Common Test, implemented by ct_telnet, + ct_ssh, ct_ftp etc, do verbose printing to the test case logs. This can be switched off + by means of the -silent_connections flag:

 	ct_run -silent_connections [conn_types]
       
-

where conn_types specifies telnet, ftp, rpc and/or snmp.

+

where conn_types specifies ssh, telnet, ftp, rpc and/or snmp.

Example:

-	ct_run ... -silent_connections telnet ftp
-

switches off logging for telnet and ftp connections.

+ ct_run ... -silent_connections ssh telnet +

switches off logging for ssh and telnet connections.

 	ct_run ... -silent_connections

switches off logging for all connection types.

-

Basic and important information such as opening and closing a connection, - fatal communication error and reconnection attempts will always be printed even - if logging has been suppressed for the connection type in question. However, operations - such as sending and receiving data may be performed silently.

+

Fatal communication error and reconnection attempts will always be printed even + if logging has been suppressed for the connection type in question. However, operations + such as sending and receiving data will be performed silently.

It is possible to also specify silent_connections in a test suite. This is accomplished by returning a tuple, {silent_connections,ConnTypes}, in the suite/0 or test case info list. If ConnTypes is a list of atoms - (telnet, ftp, rpc and/or snmp), output for any corresponding connections + (ssh, telnet, ftp, rpc and/or snmp), output for any corresponding connections will be suppressed. Full logging is per default enabled for any connection of type not specified in ConnTypes. Hence, if ConnTypes is the empty list, logging is enabled for all connections.

-

The silent_connections setting returned from a test case info function overrides, - for the test case in question, any setting made with suite/0 (which is the setting - used for all cases in the suite). Example:

+

Example:

 	
 	-module(my_SUITE).
+
+	suite() -> [..., {silent_connections,[telnet,ssh]}, ...].
+
 	...
-	suite() -> [..., {silent_connections,[telnet,ftp]}, ...].
-	...
+
 	my_testcase1() ->
-	[{silent_connections,[ftp]}].
+	    [{silent_connections,[ssh]}].
+
 	my_testcase1(_) ->
-	...
+	    ...
+
 	my_testcase2(_) ->
-	...
+	    ...
       

In this example, suite/0 tells Common Test to suppress - printouts from telnet and ftp connections. This is valid for + printouts from telnet and ssh connections. This is valid for all test cases. However, my_testcase1/0 specifies that - for this test case, only ftp should be silent. The result is + for this test case, only ssh should be silent. The result is that my_testcase1 will get telnet info (if any) printed - in the log, but not ftp info. my_testcase2 will get no + in the log, but not ssh info. my_testcase2 will get no info from either connection printed.

-

The -silent_connections tag (or - silent_connections tagged tuple in the call to - ct:run_test/1) overrides any settings in the test - suite.

+

silent_connections may also be specified with a term + in a test specification + (see Test + Specifications). Connections provided with the + silent_connections start flag/option, will be merged with + any connections listed in the test specification.

+ +

The silent_connections start flag/option and test + specification term, overrides any settings made by the info functions + inside the test suite.

-

Note that in the current Common Test version, the +

Note that in the current Common Test version, the silent_connections feature only works for telnet - connections. Support for other connection types will be added - in future Common Test versions.

+ and ssh connections! Support for other connection types will be added + in future Common Test versions.

-- cgit v1.2.3