Unit tests: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
(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...")
 
(No difference)

Latest revision as of 19:38, 28 November 2020

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

Install dependencies (example for Ubuntu):

sudo apt install libgtest-dev libgmock-dev

Configure OpenMW to build tests:

mkdir build && cd build
cmake .. -DBUILD_UNITTESTS=ON
make

Run all tests:

./openmw_test_suite

Run some tests:

./openmw_test_suite --gtest_filter='SettingsFileParserTest*'