From 8ebff6b45378174bba5e0f554335f18a2231a9be Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Wed, 9 Mar 2016 16:03:16 +0100 Subject: Document the new HTML improvements --- lib/common_test/doc/src/write_test_chapter.xml | 28 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'lib/common_test/doc/src/write_test_chapter.xml') diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml index 3e30974c9f..96137a632d 100644 --- a/lib/common_test/doc/src/write_test_chapter.xml +++ b/lib/common_test/doc/src/write_test_chapter.xml @@ -953,11 +953,11 @@

Common Test provides the following three main functions for printing strings:

- ct:log(Category, Importance, Format, Args) - ct:print(Category, Importance, Format, Args) - ct:pal(Category, Importance, Format, Args) + ct:log(Category, Importance, Format, FormatArgs, Opts) + ct:print(Category, Importance, Format, FormatArgs) + ct:pal(Category, Importance, Format, FormatArgs) -

The log/1,2,3,4 function +

The log/1,2,3,4,5 function prints a string to the test case log file. The print/1,2,3,4 function prints the string to screen. @@ -1031,14 +1031,26 @@ 4. Categorized info, importance = 25 6. Categorized error, importance = 99 +

The arguments Format and FormatArgs in ct:log/print/pal are + always passed on to the stdlib function io:format/3 (For details, + see the stdlib:io manual page).

+ +

ct:pal/4 and ct:log/5 add headers to strings being printed to the + log file. The strings are also wrapped in div tags with a CSS class + attribute, so that stylesheet formatting can be applied. To disable this feature for + a printout (i.e. to get a result similar to using io:format/2), + call ct:log/5 with the no_css option.

+

How categories can be mapped to CSS tags is documented in section HTML Style Sheets in section Running Tests and Analyzing Results.

- -

The arguments Format and Args in ct:log/print/pal are - always passed on to function stdlib:io:format/3 (For details, see the - stdlib:io manual page).

+

Common Test will escape special HTML characters (<, > and &) in printouts + to the log file made with ct:pal/4 and io:format/2. In order to print + strings with HTML tags to the log, use the ct:log/5 function. The character escaping + feature is per default disabled for ct:log/5, but can be enabled with the + esc_chars option.

+

For more information about log files, see section Log Files in section Running Tests and Analyzing Results.

-- cgit v1.2.3