1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
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/.
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
23
The Initial Developer of the Original Code is Ericsson AB.
26
<title>Test Structure</title>
27
<prepared>Siri Hansen, Kenneth Lundin</prepared>
34
<title>Test structure</title>
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>
44
<title>Skipping test cases</title>
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>
52
<p>There are several different ways to state that one or more
53
test cases should be skipped:</p>
56
<item>Using <c>skip_suites</c> and <c>skip_cases</c>
58
<seealso marker="run_test_chapter#test_specifications">test specifications</seealso>.
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>
64
<item>Returning <c>{skip,Reason}</c> from the execution clause
65
of the test case.</item>
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
73
<p>When a test case is skipped, it will be noted as <c>SKIPPED</c>
79
<title>Definition of terms</title>
83
<tag><em>data_dir</em></tag>
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.
90
<tag><em>major log file</em></tag>
92
An overview log file for one or more test suites.
95
<tag><em>minor log file</em></tag>
97
A log file for one particular test case.
99
<tag><em>priv_dir</em></tag>
101
Private directory for a test suite. This directory should
102
be used when the test suite needs to write to files.
105
<tag><em>test case</em></tag>
107
A single test included in a test suite. A test case is
108
implemented as a function in a test suite module.
111
<tag><em>test suite</em></tag>
113
An erlang module containing a collection of test cases for
114
a specific functional area.
117
<tag><em>test directory</em></tag>
119
A directory that contains one or more test suite modules, i.e.
120
a group of test suites.