## 4 Test Structure

### 4.1 Test structure

A test consists of a set of test cases. Each test case is implemented as an Erlang function. An Erlang module implementing one or more test cases is called a test suite. One or more test suites are stored in a test directory.

### 4.2 Skipping test cases

It is possible to skip certain test cases, for example if you know beforehand that a specific test case fails. This might be functionality which isn't yet implemented, a bug that is known but not yet fixed or some functionality which doesn't work or isn't applicable on a specific platform.

There are several different ways to state that one or more test cases should be skipped:

- Using skip_suites and skip_cases terms in test specifications.
- Returning {skip,Reason} from the init_per_testcase/2 or init_per_suite/1 functions.
- Returning {skip,Reason} from the execution clause of the test case.

The latter of course means that the execution clause is actually called, so the author must make sure that the test case is not run.

When a test case is skipped, it will be noted as SKIPPED in the HTML log.

### 4.3 Definition of terms

data_dir
  Data directory for a test suite. This directory contains any files used by the test suite, e.g. additional Erlang modules, binaries or data files.
major log file
  An overview log file for one or more test suites.
minor log file
  A log file for one particular test case.
priv_dir
  Private directory for a test suite. This directory should be used when the test suite needs to write to files.
test case
  A single test included in a test suite. A test case is implemented as a function in a test suite module.
test suite
  An erlang module containing a collection of test cases for a specific functional area.
test directory
  A directory that contains one or more test suite modules, i.e. a group of test suites.

common_test 1.4.5
Copyright © 1991-2009 Ericsson AB