From 2c30e9a26f6e7a4561473207d2e0d3cc69d9429f Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Thu, 13 Apr 2017 13:54:43 +0200 Subject: Add details about CSS usage in the User's Guide --- lib/common_test/doc/src/run_test_chapter.xml | 44 ++++++++++++++++++---------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'lib/common_test/doc/src') diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 76e306c4ed..c4552779f8 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -1322,8 +1322,8 @@ The Unexpected I/O Log

The test suites overview page includes a link to the Unexpected I/O Log. In this log, Common Test saves printouts made with - ct:log/2 and - ct:pal/2, as well as captured system + ct:log/1,2,3,4,5 and + ct:pal/1,2,3,4,5, as well as captured system error- and progress reports, which cannot be associated with particular test cases and therefore cannot be written to individual test case log files. This occurs, for example, if a log printout is made from an external process (not a test @@ -1338,7 +1338,7 @@ The Pre- and Post Test I/O Log

The Common Test Framework Log page includes links to the Pre- and Post Test I/O Log. In this log, Common Test saves printouts made - with ct:log/2 and ct:pal/2, as well as captured system error- + with ct:log/1,2,3,4,5 and ct:pal/1,2,3,4,5, as well as captured system error- and progress reports, which take place before, and after, the test run. Examples of this are printouts from a CT hook init- or terminate function, or progress reports generated when an OTP application is started from a CT hook @@ -1349,8 +1349,8 @@ applications, see section Synchronizing in section Common Test Hooks.

-

Logging to file with ct:log/2 or ct:pal/2 - only works when Common Test is running. Printouts with ct:pal/2 +

Logging to file with ct:log/1,2,3,4,5 or ct:pal/1,2,3,4,5 + only works when Common Test is running. Printouts with ct:pal/1,2,3,4,5 are however always displayed on screen.

@@ -1371,24 +1371,38 @@

Common Test includes an optional feature to allow user HTML style sheets for customizing printouts. The functions in ct that print to a test case HTML log - file (log/3 and pal/3) accept Category + file (log/3,4,5 and pal/3,4,5) accept Category as first argument. With this argument a category can be specified - that can be mapped to a selector in a CSS - definition. This is useful, especially for coloring text + that can be mapped to a named div selector in a CSS rule-set. + This is useful, especially for coloring text differently depending on the type of (or reason for) the - printout. Say you want one color for test system + printout. Say you want one particular background color for test system configuration information, a different one for test system state information, and finally one for errors detected by the test case functions. The corresponding style sheet can look as follows:

- div.sys_config  { background:blue; color:white }
- div.sys_state   { background:yellow; color:black }
- div.error       { background:red; color:white }
+ div.sys_config { background:blue } + div.sys_state { background:yellow } + div.error { background:red } + +

Common Test prints the text from ct:log/3,4,5 or + ct:pal/3,4,5 inside a pre element + nested under the named div element. Since the pre selector + has a predefined CSS rule (in file ct_default.css) for the attributes + color, font-family and font-size, if a user wants to + change any of the predefined attribute settings, a new rule for pre + must be added to the user stylesheet. Example:

+ +
+div.error pre { color:white }
+ +

Here, white text is used instead of the default black for div.error + printouts (and no other attribute settings for pre are affected).

To install the CSS file (Common Test inlines the definition in the - HTML code), the name can be provided when executing ct_run.

+ HTML code), the file name can be provided when executing ct_run.

Example:

@@ -1436,8 +1450,8 @@
 	  suite.

Argument Category in the previous example can have the - value (atom) sys_config (white on blue), sys_state - (black on yellow), or error (white on red).

+ value (atom) sys_config (blue background), sys_state + (yellow background), or error (white text on red background).

-- cgit v1.2.3