diff --git a/backend/tests/README b/backend/tests/README index 48f4f7a5..2d689141 100644 --- a/backend/tests/README +++ b/backend/tests/README @@ -8,8 +8,18 @@ ZINT_TEST option enabled: mkdir build cd build cmake -DZINT_TEST=ON .. - make + cmake --build . +When using generators that support multiple build configurations, such as +Visual C++ Project Files (the default generator on win32), the configuration +can be provided via --config: + + cd + mkdir build + cd build + cmake -DZINT_TEST=ON .. + cmake --build . --config Debug + ------------------------------------------------------------------------------ In order to run the test suite, the path of the zint library may need to be @@ -29,6 +39,12 @@ To run all tests (within ): ctest +When using a generator that does support multiple build configurations, the +configuration that was used to build the project has to be explicitly provided +to ctest, even if it was the default one: + + ctest -C Debug + For various useful options, e.g. matching (-R) and excluding (-E) tests, see https://cmake.org/cmake/help/latest/manual/ctest.1.html#options diff --git a/backend_qt/CMakeLists.txt b/backend_qt/CMakeLists.txt index a4897c11..7053a399 100644 --- a/backend_qt/CMakeLists.txt +++ b/backend_qt/CMakeLists.txt @@ -21,7 +21,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/backend") target_link_libraries(${PROJECT_NAME} zint Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui) -if(ZINT_TEST AND NOT WIN32) # Fails with "Test not available without configuration" on Windows so skip +if(ZINT_TEST) add_subdirectory(tests) endif()