Alec Leamas 5ab4db03b4 tests: disable a test on windows (bad timing). 1 week ago
..
testdata b576d07444 tests: tests for old an new use cases 4 months ago
CMakeLists.txt 22b22b5954 Add new output buffering (#3391). 1 week ago
README.md 63da340bd2 CMakeLists, test/README.md: More windows fixes. 1 year ago
buffer_tests.cpp 5ab4db03b4 tests: disable a test on windows (bad timing). 1 week ago
cli_server.cpp 30c57624cb includes: Force use of model/ prefix 4 months ago
cmdline_server.py e066a0932c New framework for local communications. 4 months ago
dbus_tests.cpp fb7b2f392a First round of -c implementation 1 month ago
ipc-srv-tests.cpp fb7b2f392a First round of -c implementation 1 month ago
ipc_client.cpp 30c57624cb includes: Force use of model/ prefix 4 months ago
n2k_tests.cpp 53466fd1d6 globals: move pAISMOBRoute and AISTargetNameFileName to model 3 months ago
rest-tests.cpp 5b0f4ecdbd tests: Add PluginMsg smoke test 2 months ago
std_instance.cpp fb7b2f392a First round of -c implementation 1 month ago
test_server.py e066a0932c New framework for local communications. 4 months ago
tests.cpp 68f94b1895 Add a OCPN_DISTRO_BUILD configuration variable 1 week ago
testvers.cpp 30c57624cb includes: Force use of model/ prefix 4 months ago
wx_instance.cpp fb7b2f392a First round of -c implementation 1 month ago

README.md

Provisionary Unittest README

This directory contains a very small set of unit tests. They are hooked up in the overall OpenCPN build.

Running the tests requires the ctest runner which comes with cmake. Other runners are available, but ctest seems to do the job.

Build and run is basically about first running the ordinary build. After a successful build, tests are run using

$ cd build
$ cmake --build . --target=run-tests

On non-windows platforms, make run-testscan be used instead.

Running tests on Windows

Unfortunately, things are a little more convoluted on Windows. To work %PATH% must include both the cmake binary directory and the path to buildwin

The cmake binary directory contains cmake.exe. If cmake can be invoked on the command line, this means %PATH% already contains this directory. If not it can be added on a standard install using

> set PATH=%PATH%;C:\Program Files\CMake\bin

The buildwin directory can be added either as an absolute path or a relative one. If relative, it is rooted in build\test and added using

> set PATH=%PATH%;..\..\buildwin

Once %PATH% is set up tests are run using

> cd build
> cmake --build . --target=run-tests --config RelWithDebInfo

Common error is test.exe failing with message Result: Exit code 0xc0000135. This is usually caused by test.exe not being able to load the shared libraries in buildwin. Check that buildwin is part pf %PATH%, see above.