1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Fix make test

Fixed `make test` so that it runs unit tests.

codership/wsrep-lib#7
This commit is contained in:
Daniele Sciascia
2018-10-19 10:49:04 +02:00
committed by Teemu Ollakka
parent 435b589ff5
commit cf434f3da5
3 changed files with 7 additions and 8 deletions

View File

@ -5,7 +5,6 @@
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8)
project (wsrep-lib) project (wsrep-lib)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CTest)
# Options # Options
@ -13,7 +12,7 @@ include(CTest)
option(WSREP_LIB_WITH_UNIT_TESTS "Compile unit tests" ON) option(WSREP_LIB_WITH_UNIT_TESTS "Compile unit tests" ON)
if (WSREP_LIB_WITH_UNIT_TESTS) if (WSREP_LIB_WITH_UNIT_TESTS)
# Run tests automatically by default if compiled # Run tests automatically by default if compiled
option(WSREP_LIB_WITH_AUTO_TEST "Run unit tests automatically after build" ON) option(WSREP_LIB_WITH_AUTO_TEST "Run unit tests automatically after build" OFF)
endif() endif()
# Build a sample program # Build a sample program
@ -81,9 +80,9 @@ endif()
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(wsrep-API) add_subdirectory(wsrep-API)
if (WSREP_LIB_WITH_UNIT_TESTS) if (WSREP_LIB_WITH_UNIT_TESTS)
enable_testing()
add_subdirectory(test) add_subdirectory(test)
endif() endif()
if (WSREP_LIB_WITH_DBSIM) if (WSREP_LIB_WITH_DBSIM)
add_subdirectory(dbsim) add_subdirectory(dbsim)
endif() endif()

View File

@ -33,7 +33,7 @@ In order to build the library, run
* WSREP_LIB_WITH_UNIT_TESTS - Compile unit tests (default ON) * WSREP_LIB_WITH_UNIT_TESTS - Compile unit tests (default ON)
* WSREP_LIB_WITH_AUTO_TEST - Run unit tests automatically as a part * WSREP_LIB_WITH_AUTO_TEST - Run unit tests automatically as a part
of compilation (default ON) of compilation (default OFF)
* WSREP_LIB_WITH_DBSIM - Compile sample program (default ON) * WSREP_LIB_WITH_DBSIM - Compile sample program (default ON)
* WSREP_LIB_WITH_ASAN - Enable address sanitizer instrumentation (default OFF) * WSREP_LIB_WITH_ASAN - Enable address sanitizer instrumentation (default OFF)
* WSREP_LIB_WITH_TSAN - Enable thread sanitizer instrumentation (default OFF) * WSREP_LIB_WITH_TSAN - Enable thread sanitizer instrumentation (default OFF)

View File

@ -13,11 +13,11 @@ add_executable(wsrep-lib_test
transaction_test_2pc.cpp transaction_test_2pc.cpp
wsrep-lib_test.cpp wsrep-lib_test.cpp
) )
target_link_libraries(wsrep-lib_test wsrep-lib) target_link_libraries(wsrep-lib_test wsrep-lib)
add_test(NAME wsrep-lib_test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} add_test(NAME wsrep-lib_test
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/wsrep-lib_test COMMAND wsrep-lib_test)
)
if (WSREP_LIB_WITH_AUTO_TEST) if (WSREP_LIB_WITH_AUTO_TEST)
set(UNIT_TEST wsrep-lib_test) set(UNIT_TEST wsrep-lib_test)