Skip to content

Testing with Common Test

Walter Weinmann edited this page Nov 11, 2016 · 14 revisions

1. Common Test Environment

All files related to Common Test can be found in the directory test. The main components in directory ct are:

  • test specification files - suffixed with .spec -, eg. all.spec,
  • for each test suite, e.g. for module generic_x...x.erl:
    • a directory containing test suite related data: generic_x...x_SUITE_DATA,
    • the test suite module file, e.g. generic_x...x_SUITE.erl,
    • the compiled test suite module file, e.g. generic_x...x_SUITE.beam.

Furthermore, the following files have been adjusted:

  • .gitignore: defines the test suite beam files and the test result files to be ignored,
  • .travis.yml: adds a rebar ct command (after success),
  • rebar.config: defines the Common Test directory and the associated log file directory.

2. Running Tests

Common Test, eunit and coverage analysis can all be executed from the command line with the appropriate rebar3 commands. The execution of Common Test is also be included in Travis CI.

3. Checking Test Results

The results of the common test execution can be checked in the following file:

file:///.../ocparse/_build/test/logs/index.html

The results of the coverage analysis can be checked in the following file:

file:///.../ocparse/_build/test/cover/index.html

4 Travis CI

Common Test is currently configured as a after success script in Travis CI. This has the disadvantage, that the build of ocparse is marked as successfull even if Common Test fails.

Clone this wiki locally