FennelUnitTests

From Eigenpedia

Jump to: navigation, search

Running Tests

There are various ways to run the Fennel unit tests:

  • See FennelBuildSystem#Tests for test build/setup information.
  • To run all tests, make check from the open/fennel directory
  • To run the default test suite in a single test class (e.g. fennel/test/LogicalTxnTest.cpp), cd to the test directory and run the corresponding executable, e.g. cd fennel/test then run LogicalTxnTest.
  • To run a single test method (or a subset based on a pattern), use the -t flag, e.g. LogicalTxnTest -t testRollbackShort
    • For information on test name patterns, see the Boost docs.
  • Certain tests define "extra" methods which are not run as part of the default suite because they take too long, require non-standard resources, etc. You can include these in the run by supplying the -all parameter. You need to do this even if you are using -t to specify the test by name, otherwise it will not be found.
  • To define a test method as "extra", wrap the method declaration using FENNEL_EXTRA_UNIT_TEST_CASE() instead of the normal FENNEL_UNIT_TEST_CASE().

Here's the full syntax for running one test class:

TestClass [-v] [-t testMethodName | -all] {param=val}* [configFileName | -]

  • -v (verbose) dumps any parameter values read from a config file
  • -t/-all controls method selection
  • For more available command-line options, run the test with -?
  • Config parameters can be set either directly on the command line or in a config file; in a config file, use a space between name and value instead of an equals sign

For a list of potentially applicable parameters, see FennelParameters. You can discover the parameters actually used by a test by looking at test's trace output after execution.

See also FennelTracing.

Personal tools