~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/common_test/doc/src/test_structure_chapter.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
 
3
 
 
4
<chapter>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>2006</year>
 
8
      <year>2008</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>Test Structure</title>
 
27
    <prepared>Siri Hansen, Kenneth Lundin</prepared>
 
28
    <docno></docno>
 
29
    <date></date>
 
30
    <rev></rev>
 
31
  </header>
 
32
 
 
33
  <section>
 
34
    <title>Test structure</title>
 
35
 
 
36
    <p>A test consists of a set of test cases. Each test case is
 
37
    implemented as an Erlang function. An Erlang module implementing
 
38
    one or more test cases is called a test suite. One or more test 
 
39
    suites are stored in a test directory.</p>
 
40
 
 
41
  </section>
 
42
 
 
43
  <section>
 
44
    <title>Skipping test cases</title>
 
45
 
 
46
    <p>It is possible to skip certain test cases, for example if you
 
47
    know beforehand that a specific test case fails. This might be
 
48
    functionality which isn't yet implemented, a bug that is known but
 
49
    not yet fixed or some functionality which doesn't work or isn't
 
50
    applicable on a specific platform.</p>
 
51
 
 
52
    <p>There are several different ways to state that one or more 
 
53
    test cases should be skipped:</p>
 
54
    <list>
 
55
 
 
56
      <item>Using <c>skip_suites</c> and <c>skip_cases</c>
 
57
      terms in 
 
58
      <seealso marker="run_test_chapter#test_specifications">test specifications</seealso>.
 
59
      </item>
 
60
 
 
61
      <item>Returning <c>{skip,Reason}</c> from the
 
62
      <c>init_per_testcase/2</c> or <c>init_per_suite/1</c> functions.</item>
 
63
 
 
64
      <item>Returning <c>{skip,Reason}</c> from the execution clause
 
65
      of the test case.</item>
 
66
 
 
67
    </list>
 
68
 
 
69
    <p>The latter of course means that the execution clause is
 
70
    actually called, so the author must make sure that the test case
 
71
    is not run.</p>
 
72
 
 
73
    <p>When a test case is skipped, it will be noted as <c>SKIPPED</c>
 
74
    in the HTML log.</p>
 
75
 
 
76
  </section>
 
77
 
 
78
  <section>
 
79
    <title>Definition of terms</title>
 
80
    
 
81
    <taglist>
 
82
      
 
83
      <tag><em>data_dir</em></tag>
 
84
      <item>
 
85
        Data directory for a test suite. This directory contains
 
86
        any files used by the test suite, e.g. additional Erlang
 
87
        modules, binaries or data files.
 
88
      </item>
 
89
      
 
90
      <tag><em>major log file</em></tag>
 
91
      <item>
 
92
        An overview log file for one or more test suites.
 
93
      </item>
 
94
 
 
95
      <tag><em>minor log file</em></tag>
 
96
      <item>
 
97
        A log file for one particular test case.
 
98
      </item>
 
99
      <tag><em>priv_dir</em></tag>
 
100
      <item>
 
101
        Private directory for a test suite. This directory should
 
102
        be used when the test suite needs to write to files.
 
103
      </item>
 
104
 
 
105
      <tag><em>test case</em></tag>
 
106
      <item>
 
107
        A single test included in a test suite. A test case is
 
108
        implemented as a function in a test suite module.
 
109
      </item>
 
110
      
 
111
      <tag><em>test suite</em></tag>
 
112
      <item>
 
113
        An erlang module containing a collection of test cases for
 
114
        a specific functional area.
 
115
      </item>
 
116
 
 
117
      <tag><em>test directory</em></tag>
 
118
      <item>
 
119
        A directory that contains one or more test suite modules, i.e.
 
120
        a group of test suites.
 
121
      </item>
 
122
    </taglist>
 
123
    
 
124
  </section>
 
125
 
 
126
 
 
127
</chapter>
 
128