Alec Leamas 5ab4db03b4 tests: disable a test on windows (bad timing). | 1 week ago | |
---|---|---|
.. | ||
testdata | 4 months ago | |
CMakeLists.txt | 1 week ago | |
README.md | 1 year ago | |
buffer_tests.cpp | 1 week ago | |
cli_server.cpp | 4 months ago | |
cmdline_server.py | 4 months ago | |
dbus_tests.cpp | 1 month ago | |
ipc-srv-tests.cpp | 1 month ago | |
ipc_client.cpp | 4 months ago | |
n2k_tests.cpp | 3 months ago | |
rest-tests.cpp | 2 months ago | |
std_instance.cpp | 1 month ago | |
test_server.py | 4 months ago | |
tests.cpp | 1 week ago | |
testvers.cpp | 4 months ago | |
wx_instance.cpp | 1 month ago |
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-tests
can be used instead.
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.