diff options
| author | Peter Andersson <[email protected]> | 2011-09-30 13:56:43 +0200 | 
|---|---|---|
| committer | Peter Andersson <[email protected]> | 2011-09-30 13:56:43 +0200 | 
| commit | 1a42cde6d62a8ec0f9e22215d3c3ec655201c78f (patch) | |
| tree | d3729d375e6f59fdad22a45e4d44175ca50fc482 /lib/common_test | |
| parent | 1f17c7bea8fe17cc450b6e9c72234e249d4931b4 (diff) | |
| parent | 09fbbccd5a8638601e44c605cd887f90b85d7d60 (diff) | |
| download | otp-1a42cde6d62a8ec0f9e22215d3c3ec655201c78f.tar.gz otp-1a42cde6d62a8ec0f9e22215d3c3ec655201c78f.tar.bz2 otp-1a42cde6d62a8ec0f9e22215d3c3ec655201c78f.zip | |
Merge branch 'peppe/common_test/r14b04_docs' into dev
* peppe/common_test/r14b04_docs:
  Update documentation
  Rid ct_telnet of doc build warnings
Diffstat (limited to 'lib/common_test')
| -rw-r--r-- | lib/common_test/doc/src/ct_run.xml | 7 | ||||
| -rw-r--r-- | lib/common_test/doc/src/run_test_chapter.xml | 35 | ||||
| -rw-r--r-- | lib/common_test/src/ct_telnet.erl | 9 | 
3 files changed, 44 insertions, 7 deletions
| diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml index 1ab563d74f..9045646733 100644 --- a/lib/common_test/doc/src/ct_run.xml +++ b/lib/common_test/doc/src/ct_run.xml @@ -83,7 +83,7 @@      <title>Run tests from command line</title>      <pre>  	ct_run [-dir TestDir1 TestDir2 .. TestDirN] | -	[-suite Suite1 Suite2 .. SuiteN +	[[-dir TestDir] -suite Suite1 Suite2 .. SuiteN  	 [[-group Group1 Group2 .. GroupN] [-case Case1 Case2 .. CaseN]]]  	[-step [config | keep_inactive]]  	[-config ConfigFile1 ConfigFile2 .. ConfigFileN] @@ -92,6 +92,7 @@  	[-decrypt_key Key] | [-decrypt_file KeyFile]  	[-label Label]  	[-logdir LogDir] +	[-logopts LogOpts]  	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]  	[-stylesheet CSSFile]  	[-cover CoverCfgFile] @@ -117,6 +118,7 @@  	[-decrypt_key Key] | [-decrypt_file KeyFile]  	[-label Label]  	[-logdir LogDir] +	[-logopts LogOpts]  	[-allow_user_terms]  	[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]  	[-stylesheet CSSFile] @@ -138,10 +140,11 @@      <pre>          ct_run -vts [-browser Browser]          [-dir TestDir1 TestDir2 .. TestDirN] | -        [-suite Suite [[-group Group] [-case Case]]] +        [[dir TestDir] -suite Suite [[-group Group] [-case Case]]]  	[-config ConfigFile1 ConfigFile2 .. ConfigFileN]  	[-userconfig CallbackModule1 ConfigString1 and CallbackModule2           ConfigString2 and .. and CallbackModuleN ConfigStringN] +	[-logopts LogOpts]  	[-decrypt_key Key] | [-decrypt_file KeyFile]  	[-include InclDir1 InclDir2 .. InclDirN]  	[-no_auto_compile] diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index e944f215f6..d3c6847d85 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -128,6 +128,15 @@      <p><c>$ ct_run -suite $SYS1_TEST/setup_SUITE -case start stop</c></p>      <p><c>$ ct_run -suite $SYS1_TEST/setup_SUITE -group installation -case start stop</c></p> +    <p>It is also possible to combine the <c>dir</c>, <c>suite</c> and <c>group/case</c> flags. E.g, to run +    <c>x_SUITE</c> and <c>y_SUITE</c> in directory <c>testdir</c>:</p> + +    <p><c>$ ct_run -dir ./testdir -suite x_SUITE y_SUITE</c></p> + +    <p>This has the same effect as calling:</p> + +    <p><c>$ ct_run -suite ./testdir/x_SUITE ./testdir/y_SUITE</c></p> +      <p>Other flags that may be used with <c>ct_run</c>:</p>      <list>        <item><c><![CDATA[-logdir <dir>]]></c>, specifies where the HTML log files are to be written.</item> @@ -165,6 +174,8 @@        <item><c><![CDATA[-decrypt_file <key_file>]]></c>, points out a file containing a decryption key for           <seealso marker="config_file_chapter#encrypted_config_files">encrypted configuration files</seealso>.</item>        <item><c><![CDATA[-basic_html]]></c>, switches off html enhancements that might not be compatible with older browsers.</item> +      <item><c><![CDATA[-logopts <opts>]]></c>, makes it possible to modify aspects of the logging behaviour, see +        <seealso marker="run_test_chapter#logopts">Log options</seealso> below.</item>      </list>      <note><p>Directories passed to Common Test may have either relative or absolute paths.</p></note> @@ -645,6 +656,30 @@  	to follow test progress simply by refreshing pages in the HTML browser.  	Statistics totals are not presented until a test is complete however.</p> +	<section> +	  <marker id="logopts"></marker> +	  <title>Log options</title> +	  <p>With the <c>logopts</c> start flag, it's possible to specify +	  options that modify some aspects of the logging behaviour. +	  Currently, the following options are available:</p> +	  <list> +	    <item><c>no_src</c></item> +	    <item><c>no_nl</c></item> +	  </list> +	  <p>With <c>no_src</c>, the html version of the test suite source +	  code will not be generated during the test run (and consequently +	  not be available in the log file system).</p> +	  <p>With <c>no_nl</c>, Common Test will not add a newline character +	  (\n) to the end of an output string that it receives from a call to e.g. +	  <c>io:format/2</c>, and which it prints to the test case log.</p> +	  <p>For example, if a test is started with:</p> +	  <p><c>$ ct_run -suite my_SUITE -logopts no_src</c></p> +	  <p>then printouts during the test made by successive calls to <c>io:format("x")</c>, +	  will appear in the test case log as:</p> +	  <p><c>xxx</c></p> +	  <p>instead of each <c>x</c> printed on a new line, which is the default behaviour.</p> +	</section> +        </section>        <section> diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl index c6f5fd7df4..71a784870c 100644 --- a/lib/common_test/src/ct_telnet.erl +++ b/lib/common_test/src/ct_telnet.erl @@ -245,7 +245,6 @@ cmdf(Connection,CmdFormat,Args) ->  %%%      Data = [string()]  %%% @doc Send a telnet command and wait for prompt   %%%      (uses a format string and list of arguments to build the command). -%%%-----------------------------------------------------------------  cmdf(Connection,CmdFormat,Args,Timeout) when is_list(Args) ->      Cmd = lists:flatten(io_lib:format(CmdFormat,Args)),      cmd(Connection,Cmd,Timeout). @@ -360,15 +359,15 @@ expect(Connection,Patterns) ->  %%% will also be a <code>HaltReason</code> returned.</p>  %%%  %%% <p><underline>Examples:</underline><br/> -%%% <code>expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}], -%%% [sequence,{halt,[{nnn,"NNN"}]}]).</code><br/> will try to match +%%% <code>expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}],</code> +%%% <code>[sequence,{halt,[{nnn,"NNN"}]}]).</code><br/> will try to match  %%% "ABC" first and then "XYZ", but if "NNN" appears the function will  %%% return <code>{error,{nnn,["NNN"]}}</code>. If both "ABC" and "XYZ"  %%% are matched, the function will return  %%% <code>{ok,[AbcMatch,XyzMatch]}</code>.</p>  %%% -%%% <p><code>expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}], -%%% [{repeat,2},{halt,[{nnn,"NNN"}]}]).</code><br/> will try to match +%%% <p><code>expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}],</code> +%%% <code>[{repeat,2},{halt,[{nnn,"NNN"}]}]).</code><br/> will try to match  %%% "ABC" or "XYZ" twice. If "NNN" appears the function will return  %%% with <code>HaltReason = {nnn,["NNN"]}</code>.</p>  %%% | 
