Explain how to build the tests

It may not be obvious how to build the tests, so add a section
explaining this to the existing file containing the instructions about
writing the tests and add a README to the tests directory itself to
increase chances that this file will be found -- hopefully anybody
interested in the tests will look at the README in the directory
containing them.
This commit is contained in:
Vadim Zeitlin 2021-11-12 14:21:41 +01:00
parent 755ee1cf10
commit 46973762ba
2 changed files with 40 additions and 0 deletions

View File

@ -9,6 +9,33 @@ included in wxWidgets as a submodule, so you will need to run
to get it before the first use. Catch is header-only and doesn't need to be
compiled.
Building the tests
------------------
Before starting modifying the tests, please make sure you can build the
existing tests. This requires having built the library itself successfully
first and the way to build the test must correspond to the way you used to
build the library:
- When using MSVS under MSW: just open the provided `tests/test_vcX.sln` (for
non-GUI tests) or `tests/test_gui_vcX.sln` (for the GUI ones) solution file
(where `X` corresponds to the version of MSVS you use, e.g. 16 for MSVS 2019)
and build it in the configuration of your choice.
- When using configure under Unix or in a Unix-like environment, such as MSYS:
go to the `tests` subdirectory under the _build_ directory (i.e. the
directory where you ran configure, not the one in the source tree) and run
`make test` (non-GUI tests) or `make test_gui` (GUI ones) to build.
- When using `makefile.vc` or `makefile.gcc` under MSW to build the libraries,
use the same makefile under `tests` to build the tests.
Once the tests were built successfully, you can run them to check that
everything works correctly by simply launching the corresponding test binary.
See the last subsection for more details about running the tests.
Testing with Catch
------------------

13
tests/README.md Normal file
View File

@ -0,0 +1,13 @@
Tests
-----
This directory contains tests for the library and is mostly useful for the
library developers. See the `samples` subdirectory for the examples that are
more useful to the application developers using the library.
If you do work on the library itself and would like to modify an existing or
add a new test, please see `docs/contributing/how-to-write-unit-tests.md` for
more information.
This file also contains the instructions for running the tests if you'd just
like to do it to confirm that the library works correctly.