Difference between revisions of "Testing"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
(Created page with "=Basic usage= Test can be run all at once via make <syntaxhighlight lang="bash" inline> run_all_tests </syntaxhighlight> or individually via eg. <syntaxhighlight lang="bash"...")
(No difference)

Revision as of 11:12, 28 October 2016

Basic usage

Test can be run all at once via make run_all_tests or individually via eg. make basisfunc_run_tests.

Each header file should be accompanied by a <util_name>_test.cpp with examples for all functionalities and unit tests.

Tests are written in Google test framework:

TEST(Group, Name) {
    EXPECT_EQ(a, b);
}

Compiled binary supports running only specified test. Use ./main --gtest_filter=Domain* for filtering and ./main --help for more options.

Before pushing run ./util/run_tests.sh. This script makes and executes all <util_name>_test.cpp test files, checks coding style and documentation. You can check them separately as well.

Usage: ./run_tests.sh
Options:
  -c   run only configuration
  -t   run only tests
  -s   run only stylechecks
  -d   run only docscheck
  -h   print this help
Example:
 ./run_tests.sh -sd

If anything is wrong you will get pretty little red error, but if you see green, you're good to go.

Philosophy behind testing

TO DO: JURE