Unit tests

From OpenMW Wiki
Revision as of 20:38, 28 November 2020 by Ptmikheev (talk | contribs) (Created page with "OpenMW unit tests are here: [https://gitlab.com/OpenMW/openmw/-/tree/master/apps/openmw_test_suite apps/openmw_test_suite]. It uses [https://github.com/google/googletest gtest...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

OpenMW unit tests are here: apps/openmw_test_suite. It uses gtest framework.

If you add a new component, consider to add unit tests for it as well.

How to run unit tests[edit]

Install dependencies (example for Ubuntu): <syntaxhighlight lang="bash"> sudo apt install libgtest-dev libgmock-dev </syntaxhighlight>

Configure OpenMW to build tests: <syntaxhighlight lang="bash"> mkdir build && cd build cmake .. -DBUILD_UNITTESTS=ON make </syntaxhighlight>

Run all tests: <syntaxhighlight lang="bash"> ./openmw_test_suite </syntaxhighlight>

Run some tests: <syntaxhighlight lang="bash"> ./openmw_test_suite --gtest_filter='SettingsFileParserTest*' </syntaxhighlight>