Skip to content

Writing Proteus Tests

alistairbntl edited this page Oct 3, 2017 · 2 revisions

This wiki page will be written to help with the development and design of Proteus tests.

Test Markers

Setting Test Markers

Tests should be categorized with markers which fit into one of three categories. The first marker category relates to the tests speed.

  1. 0 < test < 2 seconds : No marker - No marker is needed for tests that run in less than 2-seconds.
  2. 2 < test < 10 seconds : moderateTest
  3. test > 10 seconds : slowTest

The second marker category relates to the test's target module. In cases where a test targets the functionality of a particular module, the modules name should be used as a marker. For instance, if you are testing a function in the LinearAlgebraTools module, then the test marker should include LinearAlgebraTools.

The final marker category is for tests that do not fit neatly into a specific module. For example, one may have a test which runs a complete Poisson simulation that requires generating a mesh, building a Jacobian and completing some linear solvers. In these cases, the test marker should always include modelTest, and can also include a marker indicating the specific type of problem. Currently, we include the following

  1. poissonTest
  2. navierstokesTest

Using Test Markers

The make test command in the home Proteus directory runs the entire suite of tests.

A subset of the test suite can be run using make test TEST_MARKER="'opt_1 and opt_2 and ...'" command. For example, to run every test with the LinearAlgebraTools marker, one would run make test TEST_MARKER="'LinearAlgebraTools'".

To exclude a class of tests, use the not keyword. For example, make test TEST_MARKER="'not slowTest'" runs every test that does not have the slowTest marker.

Multiple marker restrictions are combined using and. For instance, make test TEST_MARKER="'LinearSolvers and not slowTest'" runs every LinearSolvers test that does not have the slowTest marker.