From c96a29d78a8ced79557582c631a9082705d772a3 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Sun, 11 Dec 2011 00:35:21 +0100 Subject: Document changes in test specifications (groups) and style sheets --- lib/common_test/doc/src/run_test_chapter.xml | 49 +++++++++++----------------- 1 file changed, 19 insertions(+), 30 deletions(-) (limited to 'lib/common_test/doc') diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 57059f0ba2..06d1ba8b03 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -412,6 +412,16 @@ the way from init_per_suite down to the test cases in the sub group).

+

With the GroupSpec element (below) it's possible to specify + group execution properties that will override those specified in the + group definition (i.e. in groups/0). Execution properties for + sub-groups may be overridden as well. This feature makes it possible to + change properties of groups at the time of execution, + without even having to edit the test suite. More detailed documentation, + and examples, can be found in the + + Test case groups chapter.

+

Below is the test specification syntax. Test specifications can be used to run tests both in a single test host environment and in a distributed Common Test environment (Large Scale @@ -475,8 +485,8 @@ {groups, DirRef, Suite, Groups}. {groups, NodeRefsDirRef, Suite, Groups}. - {groups, DirRef, Suite, Group, {cases,Cases}}. - {groups, NodeRefsDirRef, Suite, Group, {cases,Cases}}. + {groups, DirRef, Suite, GroupSpec, {cases,Cases}}. + {groups, NodeRefsDirRef, Suite, GroupSpec, {cases,Cases}}. {cases, DirRef, Suite, Cases}. {cases, NodeRefs, DirRef, Suite, Cases}. @@ -510,7 +520,8 @@ DirRef = DirAlias | Dir Suites = atom() | [atom()] | all Suite = atom() - Groups = atom() | [atom()] | all + Groups = GroupSpec | [GroupSpec] | all + GroupSpec = Group | {Group,Properties} | {Group,Properties,GroupSpec} Group = atom() Cases = atom() | [atom()] | all Comment = string() | "" @@ -708,22 +719,16 @@ look like this:

-<style>
-  div.ct_internal { background:lightgrey; color:black }
-  div.default     { background:lightgreen; color:black }
-  div.sys_config  { background:blue; color:white }
-  div.sys_state   { background:yellow; color:black }
-  div.error       { background:red; color:white }
-</style>
-	
+ div.sys_config { background:blue; color:white } + div.sys_state { background:yellow; color:black } + div.error { background:red; color:white }

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

-	  $ ct_run -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 are on a global test level in the sense that they can be used in any @@ -744,8 +749,7 @@ ct:log(sys_state, "Connections: ~p", [ConnectionInfo]), ... ct:pal(error, "Error ~p detected! Info: ~p", [SomeFault,ErrorInfo]), - ct:fail(SomeFault). - + ct:fail(SomeFault).

If the style sheet is installed as in this example, the categories are private to the suite in question. They can be used by all test cases in the @@ -769,21 +773,6 @@

The Category argument in the example above may have the value (atom) sys_config (white on blue), sys_state (black on yellow) or error (white on red).

- -

If the Category argument is not specified, Common Test will - use the CSS selector div.default for the - printout. For this reason a user supplied style sheet must - include this selector. Also the selector - div.ct_internal must be included. Hence a minimal - user style sheet should look like this (which is also the - default style sheet Common Test uses if no user CSS file is - provided):

-
-	  <style>
-	  div.ct_internal { background:lightgrey; color:black }
-	  div.default     { background:lightgreen; color:black }
-	  </style>
-	
-- cgit v1.2.3