From 6693ec7fd21b3325495f1a3dd4139e39f056f790 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Nov 2010 11:30:08 +0100 Subject: Update documentation after rename of run_test to ct_run --- lib/common_test/doc/src/Makefile | 2 +- lib/common_test/doc/src/config_file_chapter.xml | 2 +- lib/common_test/doc/src/cover_chapter.xml | 4 +- lib/common_test/doc/src/ct_junit_report.xml | 109 +++++++++++++ lib/common_test/doc/src/ct_master_chapter.xml | 2 +- lib/common_test/doc/src/ct_run.xml | 179 +++++++++++++++++++++ lib/common_test/doc/src/event_handler_chapter.xml | 6 +- lib/common_test/doc/src/install_chapter.xml | 16 +- lib/common_test/doc/src/ref_man.xml | 2 +- lib/common_test/doc/src/run_test.xml | 179 --------------------- lib/common_test/doc/src/run_test_chapter.xml | 94 +++++------ lib/common_test/doc/src/test_structure_chapter.xml | 2 +- 12 files changed, 353 insertions(+), 244 deletions(-) create mode 100644 lib/common_test/doc/src/ct_junit_report.xml create mode 100644 lib/common_test/doc/src/ct_run.xml delete mode 100644 lib/common_test/doc/src/run_test.xml (limited to 'lib/common_test') diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile index 6322860088..1a767a8197 100644 --- a/lib/common_test/doc/src/Makefile +++ b/lib/common_test/doc/src/Makefile @@ -51,7 +51,7 @@ CT_MODULES = \ CT_XML_FILES = $(CT_MODULES:=.xml) XML_APPLICATION_FILES = ref_man.xml -XML_REF1_FILES = run_test.xml +XML_REF1_FILES = ct_run.xml XML_REF3_FILES = $(CT_XML_FILES) XML_REF6_FILES = common_test_app.xml diff --git a/lib/common_test/doc/src/config_file_chapter.xml b/lib/common_test/doc/src/config_file_chapter.xml index 77b0c0c0b7..59151a73ec 100644 --- a/lib/common_test/doc/src/config_file_chapter.xml +++ b/lib/common_test/doc/src/config_file_chapter.xml @@ -248,7 +248,7 @@

Callback:check_parameter/1

The input argument will be passed from Common Test, as defined in the test - specification or given as an option to run_test.

+ specification or given as an option to ct_run or ct:run_test.

The return value should be any of the following values indicating if given configuration parameter is valid:

diff --git a/lib/common_test/doc/src/cover_chapter.xml b/lib/common_test/doc/src/cover_chapter.xml index 6e4f59ef73..377409ed7b 100644 --- a/lib/common_test/doc/src/cover_chapter.xml +++ b/lib/common_test/doc/src/cover_chapter.xml @@ -94,10 +94,10 @@

To activate the code coverage support, you simply specify the name of the cover specification file as you start Common Test. - This you do either by using the -cover flag with run_test. + This you do either by using the -cover flag with ct_run. Example:

-

$ run_test -dir $TESTOBJS/db -cover $TESTOBJS/db/config/db.coverspec

+

$ ct_run -dir $TESTOBJS/db -cover $TESTOBJS/db/config/db.coverspec

You may also pass the cover specification file name in a call to ct:run_test/1, by adding a {cover,CoverSpec} diff --git a/lib/common_test/doc/src/ct_junit_report.xml b/lib/common_test/doc/src/ct_junit_report.xml new file mode 100644 index 0000000000..49a40cc1de --- /dev/null +++ b/lib/common_test/doc/src/ct_junit_report.xml @@ -0,0 +1,109 @@ + + + +

+ct_junit_report + + +1 + + + +A +ct_junit_report.xml
+ct_junit_report +Common Test Framework functions handling test specifications. + +

Common Test Framework functions handling test specifications.

+ +

This module creates a junit report of the test run if plugged in + as a suite_callback.

+ + +init(Opts) -> term() + + + + + + +post_end_group(Group, Config, State) -> term() + + + + + + +post_end_suite(Suite, Config, State) -> term() + + + + + + +post_end_tc(TC, Config, State) -> term() + + + + + + +post_init_group(Group, Config, State) -> term() + + + + + + +post_init_suite(Suite, Config, State) -> term() + + + + + + +pre_end_group(Group, Config, State) -> term() + + + + + + +pre_end_suite(Suite, Config, State) -> term() + + + + + + +pre_init_group(Group, Config, State) -> term() + + + + + + +pre_init_suite(Suite, Config, State) -> term() + + + + + + +pre_init_tc(TC, Config, State) -> term() + + + + + + +terminate(Config, State) -> term() + + + + + + + + + \ No newline at end of file diff --git a/lib/common_test/doc/src/ct_master_chapter.xml b/lib/common_test/doc/src/ct_master_chapter.xml index 01f8e61d36..f4f0ecad62 100644 --- a/lib/common_test/doc/src/ct_master_chapter.xml +++ b/lib/common_test/doc/src/ct_master_chapter.xml @@ -188,7 +188,7 @@ Running Test Suites chapter). The result is that any test specified to run on a node with the same name as the Common Test node in question (typically ct@somehost if started - with the run_test program), will be performed. Tests without explicit + with the ct_run program), will be performed. Tests without explicit node association will always be performed too of course!

It is recommended that absolute paths are used for log directories, diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml new file mode 100644 index 0000000000..1ab563d74f --- /dev/null +++ b/lib/common_test/doc/src/ct_run.xml @@ -0,0 +1,179 @@ + + + + +

+ + 20072010 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + The ct_run program + Peter Andersson + Peter Andersson + + + + 2010-04-01 + PA2 + ct_run.xml +
+ ct_run + Program used for starting Common Test from the + OS command line. + + + +

The ct_run program is automatically installed with Erlang/OTP + and Common Test (please see the Installation chapter in the Common + Test User's Guide for more information). The program accepts a number + of different start flags. Some flags trigger ct_run + to start the Common Test application and pass on data to it. Some + flags start an Erlang node prepared for running Common Test in a + particular mode.

+ +

There is an interface function that corresponds to this program, + called ct:run_test/1, for starting Common Test from the Erlang + shell (or an Erlang program). Please see the ct man page for + details.

+ +

ct_run also accepts Erlang emulator flags. These are used + when ct_run calls erl to start the Erlang node + (making it possible to e.g. add directories to the code server path, + change the cookie on the node, start additional applications, etc).

+ +

With the optional flag:

+
-erl_args
+

it's possible to divide the options on the ct_run command line into + two groups, one that Common Test should process (those preceding -erl_args), + and one it should completely ignore and pass on directly to the emulator + (those following -erl_args). Options preceding -erl_args that Common Test + doesn't recognize, also get passed on to the emulator untouched. + By means of -erl_args the user may specify flags with the same name, but + with different destinations, on the ct_run command line.

+

If -pa or -pz flags are specified in the Common Test group of options + (preceding -erl_args), relative directories will be converted to + absolute and re-inserted into the code path by Common Test (to avoid + problems loading user modules when Common Test changes working directory + during test runs). Common Test will however ignore -pa and -pz flags + following -erl_args on the command line. These directories are added + to the code path normally (i.e. on specified form)

+ +

If ct_run is called with option:

+
-help
+

it prints all valid start flags to stdout.

+
+ + + +
+ Run tests from command line +
+	ct_run [-dir TestDir1 TestDir2 .. TestDirN] |
+	[-suite Suite1 Suite2 .. SuiteN
+	 [[-group Group1 Group2 .. GroupN] [-case Case1 Case2 .. CaseN]]]
+	[-step [config | keep_inactive]]
+	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+	 ConfigString2 and .. and CallbackModuleN ConfigStringN]
+	[-decrypt_key Key] | [-decrypt_file KeyFile]
+	[-label Label]
+	[-logdir LogDir]
+	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
+	[-stylesheet CSSFile]
+	[-cover CoverCfgFile]
+	[-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
+        [-event_handler_init EvHandler1 InitArg1 and
+	 EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
+	[-include InclDir1 InclDir2 .. InclDirN]
+	[-no_auto_compile]
+	[-muliply_timetraps Multiplier]
+	[-scale_timetraps]
+        [-repeat N [-force_stop]] |
+        [-duration HHMMSS [-force_stop]] |
+        [-until [YYMoMoDD]HHMMSS [-force_stop]]
+	[-basic_html]
+
+
+ Run tests using test specification +
+	ct_run -spec TestSpec1 TestSpec2 .. TestSpecN
+	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+         ConfigString2 and .. and CallbackModuleN ConfigStringN]
+	[-decrypt_key Key] | [-decrypt_file KeyFile]
+	[-label Label]
+	[-logdir LogDir]
+	[-allow_user_terms]
+	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
+	[-stylesheet CSSFile]
+	[-cover CoverCfgFile]
+	[-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
+        [-event_handler_init EvHandler1 InitArg1 and
+	 EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
+	[-include InclDir1 InclDir2 .. InclDirN]
+	[-no_auto_compile]
+	[-muliply_timetraps Multiplier]
+	[-scale_timetraps]
+        [-repeat N [-force_stop]] |
+        [-duration HHMMSS [-force_stop]] |
+        [-until [YYMoMoDD]HHMMSS [-force_stop]]
+	[-basic_html]
+
+
+ Run tests in web based GUI +
+        ct_run -vts [-browser Browser]
+        [-dir TestDir1 TestDir2 .. TestDirN] |
+        [-suite Suite [[-group Group] [-case Case]]]
+	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+         ConfigString2 and .. and CallbackModuleN ConfigStringN]
+	[-decrypt_key Key] | [-decrypt_file KeyFile]
+	[-include InclDir1 InclDir2 .. InclDirN]
+	[-no_auto_compile]
+	[-muliply_timetraps Multiplier]
+	[-scale_timetraps]
+	[-basic_html]
+
+
+ Refresh the HTML index files +
+	ct_run -refresh_logs [-logdir LogDir] [-basic_html]
+
+
+ Run CT in interactive mode +
+	ct_run -shell
+	[-config ConfigFile1 ConfigFile2 ... ConfigFileN]
+	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+         ConfigString2 and .. and CallbackModuleN ConfigStringN]
+	[-decrypt_key Key] | [-decrypt_file KeyFile]
+
+
+ Start a Common Test Master node +
+	ct_run -ctmaster
+
+ +
+ See also +

Please read the Running Test Suites + chapter in the Common Test User's Guide for information about the meaning of the + different start flags.

+
+ + diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml index 7f5144b760..904876ac46 100644 --- a/lib/common_test/doc/src/event_handler_chapter.xml +++ b/lib/common_test/doc/src/event_handler_chapter.xml @@ -63,12 +63,12 @@
Usage

Event handlers may be installed by means of an event_handler - start flag (run_test) or option (ct:run_test/1), where the + start flag (ct_run) or option (ct:run_test/1), where the argument specifies the names of one or more event handler modules. Example:

-

$ run_test -suite test/my_SUITE -event_handler handlers/my_evh1 +

$ ct_run -suite test/my_SUITE -event_handler handlers/my_evh1 handlers/my_evh2 -pa $PWD/handlers

-

Use the option instead of +

Use the option instead of to pass start arguments to the event handler init function.

All event handler modules must have gen_event behaviour. Note also that diff --git a/lib/common_test/doc/src/install_chapter.xml b/lib/common_test/doc/src/install_chapter.xml index 828588a673..89c497962d 100644 --- a/lib/common_test/doc/src/install_chapter.xml +++ b/lib/common_test/doc/src/install_chapter.xml @@ -34,8 +34,8 @@ General information

The two main interfaces for running tests with Common Test - are an executable program named run_test and an - erlang module named ct. The run_test program + are an executable program named ct_run and an + erlang module named ct. The ct_run program is compiled for the underlying operating system (e.g. Unix/Linux or Windows) during the build of the Erlang/OTP system, and is installed automatically with other executable programs in @@ -43,22 +43,22 @@ The ct interface functions can be called from the Erlang shell, or from any Erlang function, on any supported platform.

-

A legacy Bourne shell script - also named run_test - exists, +

A legacy Bourne shell script - named run_test - exists, which may be manually generated and installed. This script may be used - instead of the run_test program mentioned above, e.g. if the user + instead of the ct_run program mentioned above, e.g. if the user wishes to modify or customize the Common Test start flags in a simpler - way than making changes to the run_test C program.

+ way than making changes to the ct_run C program.

The Common Test application is installed with the Erlang/OTP system and no additional installation step is required to start using - Common Test by means of the run_test executable program, and/or the interface + Common Test by means of the ct_run executable program, and/or the interface functions in the ct module. If you wish to use the legacy Bourne - shell script version of run_test, however, this script needs to be + shell script version run_test, however, this script needs to be generated first, according to the instructions below.

Before reading on, please note that since Common Test version 1.5, the run_test shell script is no longer required for starting - tests with Common Test from the OS command line. The run_test + tests with Common Test from the OS command line. The ct_run program (descibed above) is the new recommended command line interface for Common Test. The shell script exists mainly for legacy reasons and may not be updated in future releases of Common Test. It may even be removed. diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml index 8be234d979..d5985bb021 100644 --- a/lib/common_test/doc/src/ref_man.xml +++ b/lib/common_test/doc/src/ref_man.xml @@ -63,7 +63,7 @@ Server application.

- + diff --git a/lib/common_test/doc/src/run_test.xml b/lib/common_test/doc/src/run_test.xml deleted file mode 100644 index 2f0a94afba..0000000000 --- a/lib/common_test/doc/src/run_test.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - -
- - 20072010 - Ericsson AB. All Rights Reserved. - - - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - - - The run_test program - Peter Andersson - Peter Andersson - - - - 2010-04-01 - PA2 - run_test.xml -
- run_test - Program used for starting Common Test from the - OS command line. - - - -

The run_test program is automatically installed with Erlang/OTP - and Common Test (please see the Installation chapter in the Common - Test User's Guide for more information). The program accepts a number - of different start flags. Some flags trigger run_test - to start the Common Test application and pass on data to it. Some - flags start an Erlang node prepared for running Common Test in a - particular mode.

- -

There is an interface function that corresponds to this program, - called ct:run_test/1, for starting Common Test from the Erlang - shell (or an Erlang program). Please see the ct man page for - details.

- -

run_test also accepts Erlang emulator flags. These are used - when run_test calls erl to start the Erlang node - (making it possible to e.g. add directories to the code server path, - change the cookie on the node, start additional applications, etc).

- -

With the optional flag:

-
-erl_args
-

it's possible to divide the options on the run_test command line into - two groups, one that Common Test should process (those preceding -erl_args), - and one it should completely ignore and pass on directly to the emulator - (those following -erl_args). Options preceding -erl_args that Common Test - doesn't recognize, also get passed on to the emulator untouched. - By means of -erl_args the user may specify flags with the same name, but - with different destinations, on the run_test command line.

-

If -pa or -pz flags are specified in the Common Test group of options - (preceding -erl_args), relative directories will be converted to - absolute and re-inserted into the code path by Common Test (to avoid - problems loading user modules when Common Test changes working directory - during test runs). Common Test will however ignore -pa and -pz flags - following -erl_args on the command line. These directories are added - to the code path normally (i.e. on specified form)

- -

If run_test is called with option:

-
-help
-

it prints all valid start flags to stdout.

-
- - - -
- Run tests from command line -
-	run_test [-dir TestDir1 TestDir2 .. TestDirN] |
-	[-suite Suite1 Suite2 .. SuiteN
-	 [[-group Group1 Group2 .. GroupN] [-case Case1 Case2 .. CaseN]]]
-	[-step [config | keep_inactive]]
-	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
-	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
-	 ConfigString2 and .. and CallbackModuleN ConfigStringN]
-	[-decrypt_key Key] | [-decrypt_file KeyFile]
-	[-label Label]
-	[-logdir LogDir]
-	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
-	[-stylesheet CSSFile]
-	[-cover CoverCfgFile]
-	[-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
-        [-event_handler_init EvHandler1 InitArg1 and
-	 EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
-	[-include InclDir1 InclDir2 .. InclDirN]
-	[-no_auto_compile]
-	[-muliply_timetraps Multiplier]
-	[-scale_timetraps]
-        [-repeat N [-force_stop]] |
-        [-duration HHMMSS [-force_stop]] |
-        [-until [YYMoMoDD]HHMMSS [-force_stop]]
-	[-basic_html]
-
-
- Run tests using test specification -
-	run_test -spec TestSpec1 TestSpec2 .. TestSpecN
-	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
-	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
-         ConfigString2 and .. and CallbackModuleN ConfigStringN]
-	[-decrypt_key Key] | [-decrypt_file KeyFile]
-	[-label Label]
-	[-logdir LogDir]
-	[-allow_user_terms]
-	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
-	[-stylesheet CSSFile]
-	[-cover CoverCfgFile]
-	[-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
-        [-event_handler_init EvHandler1 InitArg1 and
-	 EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
-	[-include InclDir1 InclDir2 .. InclDirN]
-	[-no_auto_compile]
-	[-muliply_timetraps Multiplier]
-	[-scale_timetraps]
-        [-repeat N [-force_stop]] |
-        [-duration HHMMSS [-force_stop]] |
-        [-until [YYMoMoDD]HHMMSS [-force_stop]]
-	[-basic_html]
-
-
- Run tests in web based GUI -
-        run_test -vts [-browser Browser]
-        [-dir TestDir1 TestDir2 .. TestDirN] |
-        [-suite Suite [[-group Group] [-case Case]]]
-	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
-	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
-         ConfigString2 and .. and CallbackModuleN ConfigStringN]
-	[-decrypt_key Key] | [-decrypt_file KeyFile]
-	[-include InclDir1 InclDir2 .. InclDirN]
-	[-no_auto_compile]
-	[-muliply_timetraps Multiplier]
-	[-scale_timetraps]
-	[-basic_html]
-
-
- Refresh the HTML index files -
-	run_test -refresh_logs [-logdir LogDir] [-basic_html]
-
-
- Run CT in interactive mode -
-	run_test -shell
-	[-config ConfigFile1 ConfigFile2 ... ConfigFileN]
-	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
-         ConfigString2 and .. and CallbackModuleN ConfigStringN]
-	[-decrypt_key Key] | [-decrypt_file KeyFile]
-
-
- Start a Common Test Master node -
-	run_test -ctmaster
-
- -
- See also -

Please read the Running Test Suites - chapter in the Common Test User's Guide for information about the meaning of the - different start flags.

-
- -
diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 1efff25f5b..94fcf6bf01 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -71,7 +71,7 @@

If test suites or help modules include header files stored in other locations than the test directory, you may specify these include directories - by means of the flag with , + by means of the flag with , or the option with . In addition to this, an include path may be specified with an OS environment variable; . Example (bash):

@@ -93,7 +93,7 @@ there instead.

It is possible to disable the automatic compilation feature by using the - flag with , or + flag with , or the option with . With automatic compilation disabled, the user is responsible for compiling the test suite modules @@ -108,26 +108,26 @@

Running tests from the OS command line -

The run_test program can be used for running tests from +

The ct_run program can be used for running tests from the OS command line, e.g.

- -dir ]]> - -suite ]]> + -dir ]]> + -suite ]]> - -suite ]]> + -suite ]]> - -suite + -suite -group -case ]]>

Examples:

-

$ run_test -config $CFGS/sys1.cfg $CFGS/sys2.cfg -dir $SYS1_TEST $SYS2_TEST

-

$ run_test -userconfig ct_config_xml $CFGS/sys1.xml $CFGS/sys2.xml -dir $SYS1_TEST $SYS2_TEST

-

$ run_test -suite $SYS1_TEST/setup_SUITE $SYS2_TEST/config_SUITE

-

$ run_test -suite $SYS1_TEST/setup_SUITE -case start stop

-

$ run_test -suite $SYS1_TEST/setup_SUITE -group installation -case start stop

+

$ ct_run -config $CFGS/sys1.cfg $CFGS/sys2.cfg -dir $SYS1_TEST $SYS2_TEST

+

$ ct_run -userconfig ct_config_xml $CFGS/sys1.xml $CFGS/sys2.xml -dir $SYS1_TEST $SYS2_TEST

+

$ ct_run -suite $SYS1_TEST/setup_SUITE $SYS2_TEST/config_SUITE

+

$ ct_run -suite $SYS1_TEST/setup_SUITE -case start stop

+

$ ct_run -suite $SYS1_TEST/setup_SUITE -group installation -case start stop

-

Other flags that may be used with run_test:

+

Other flags that may be used with ct_run:

]]>, specifies where the HTML log files are to be written. ]]>, associates the test run with a name that gets printed @@ -167,20 +167,20 @@

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

Arbitrary start flags to the Erlang Runtime System may also be passed as - parameters to run_test. It is, for example, useful to be able to + parameters to ct_run. It is, for example, useful to be able to pass directories that should be added to the Erlang code server search path with the -pa or -pz flag. If you have common help- or library modules for test suites (separately compiled), stored in other directories than the test suite directories, these help/lib directories are preferrably added to the code path this way. Example:

-

$ run_test -dir ./chat_server -logdir ./chat_server/testlogs -pa $PWD/chat_server/ebin

+

$ ct_run -dir ./chat_server -logdir ./chat_server/testlogs -pa $PWD/chat_server/ebin

Note how in this example, the absolute path of the chat_server/ebin directory is passed to the code server. This is essential since relative paths are stored by the code server as relative, and Common Test changes the current working directory of the Erlang Runtime System during the test run!

-

For more information about the run_test program, see the +

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

@@ -188,7 +188,7 @@
Running tests from the Web based GUI -

The web based GUI, VTS, is started with the run_test +

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 @@ -196,22 +196,22 @@

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

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

-

Note that run_test -vts will try to open the Common Test start +

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. @@ -227,10 +227,10 @@

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 run_test program described above, only the flags are instead + 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 run_test like:

-

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

+ 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.

@@ -253,17 +253,17 @@ manually and call ct:install/1 to install any configuration data you might need (use [] as argument otherwise), then call ct:start_interactive/0 to start Common Test. If you use - the run_test program, you may start the Erlang shell and Common Test + the ct_run program, you may start the Erlang shell and Common Test in the same go by using the -shell and, optionally, the -config and/or -userconfig flag. Examples:

- run_test -shell - - + ct_run -shell + + -

If no config file is given with the run_test command, +

If no config file is given with the ct_run command, a warning will be displayed. If Common Test has been run from the same directory earlier, the same config file(s) will be used again. If Common Test has not been run from this directory before, no @@ -293,7 +293,7 @@ ctlog.html in the ]]> directory. A link to this file will be available in the file named last_interactive.html in the directory from which - you executed run_test. Currently, specifying a different + you executed ct_run. Currently, specifying a different root directory for the logs than the current working directory, is not supported.

@@ -309,7 +309,7 @@
Step by step execution of test cases with the Erlang Debugger -

By means of run_test -step [opts], or by passing the +

By means of ct_run -step [opts], or by passing the {step,Opts} option to ct:run_test/1, it is possible to get the Erlang Debugger started automatically and use its graphical interface to investigate the state of the current test @@ -345,12 +345,12 @@ for ct). 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 run_test -label), evaluate arbitrary expressions + run (similar to ct_run -label), evaluate arbitrary expressions before starting a test, import configuration data (similar to - run_test -config/-userconfig), specify HTML log directories (similar + ct_run -config/-userconfig), specify HTML log directories (similar to - run_test -logdir), give aliases to test nodes and test + 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 @@ -359,7 +359,7 @@ 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 run_test -include, see above).

+ to ct_run -include, see above).

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 @@ -535,7 +535,7 @@

It is possible for the user to provide a test specification that includes (for Common Test) unrecognizable terms. If this is desired, the -allow_user_terms flag should be used when starting tests with - run_test. This forces Common Test to ignore unrecognizable terms. + ct_run. This forces Common Test to ignore unrecognizable terms. Note that in this mode, Common Test is not able to check the specification for errors as efficiently as if the scanner runs in default mode. If ct:run_test/1 is used for starting the tests, the relaxed scanner @@ -661,11 +661,11 @@

To install the CSS file (Common Test inlines the definition in the - HTML code), the name may be provided when executing run_test. + HTML code), the name may be provided when executing ct_run. Example:

-	  $ run_test -dir $TEST/prog -stylesheet $TEST/styles/test_categories.css
+	  $ ct_run -dir $TEST/prog -stylesheet $TEST/styles/test_categories.css
 	

Categories in a CSS file installed with the -stylesheet flag @@ -738,7 +738,7 @@ means of time, it is also possible to specify what action Common Test should take upon timeout. Either Common Test performs all tests in the current run before stopping, or it stops as soon as the current test job is finished. Repetition can be activated by - means of run_test start flags, or tuples in the ct:run:test/1 + means of ct_run start flags, or tuples in the ct:run:test/1 option list argument. The flags (options in parenthesis) are:

-repeat N ({repeat,N}), where N is a positive integer. @@ -774,7 +774,7 @@

Example 1:

-          $ run_test -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -force_stop
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -force_stop

Here the suites in test directory to1, followed by the suites in to2, will be executed in one test run. A timeout event will occur after 10 minutes. As long as there is time left, Common Test will repeat the test run (i.e. starting over with the to1 test). @@ -787,7 +787,7 @@ $ date Fri Sep 28 15:00:00 MEST 2007 - $ run_test -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -until 160000 + $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -until 160000

Here the same test run as in the example above will be executed (and possibly repeated). In this example, however, the timeout will occur after 1 hour and when that happens, Common Test will finish the entire test run before stopping (i.e. the to1 and to2 test @@ -795,7 +795,7 @@

Example 3:

-          $ run_test -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -repeat 5
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -repeat 5

Here the test run, including both the to1 and the to2 test, will be repeated 5 times.

This feature should not be confused with the repeat property of a test @@ -814,7 +814,7 @@ of the -silent_connections flag:

-	run_test -silent_connections [conn_types]
+	ct_run -silent_connections [conn_types]
       

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

@@ -822,11 +822,11 @@

Example:

-	run_test ... -silent_connections telnet ftp
+ ct_run ... -silent_connections telnet ftp

switches off logging for telnet and ftp connections.

-	run_test ... -silent_connections
+ ct_run ... -silent_connections

switches off logging for all connection types.

diff --git a/lib/common_test/doc/src/test_structure_chapter.xml b/lib/common_test/doc/src/test_structure_chapter.xml index cd38ae0c7c..b9ca59135d 100644 --- a/lib/common_test/doc/src/test_structure_chapter.xml +++ b/lib/common_test/doc/src/test_structure_chapter.xml @@ -144,7 +144,7 @@ be used when the test suite needs to write to files. - run_test + ct_run The name of an executable program that may be used as an interface for specifying and running -- cgit v1.2.3