Skip to content
Hannes Hauswedell edited this page May 19, 2017 · 7 revisions

Test infrastructure

Building the tests

TODO cmake call

TODO how GoogleTest it is automatically checked

adding a test

TODO create file, add to cmake lists et cetera

Writing a test case

Basic rules

  • test the publicly specified interfaces
  • remember to test const/non-const versions
  • remember to test rvalue/lvalue versions
  • try to use generalized typed test whenever possible
  • write typed tests for your concepts and include all types that fulfill the concept

Test dependencies

  • prefer many small tests to one big test
  • try to make tests atomic, i.e. make them independent of functionality tested in other tests
  • if you need to use functionality from other tests, re-order your tests so that they only depend on previously tested functionality, not on things tested "later on"
  • never introduce circular dependencies between tests!

Example

TODO

Clone this wiki locally