1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-24 10:42:31 +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)
project (wsrep-lib)
include(CheckIncludeFile)
include(CTest)
# Options
@ -13,7 +12,7 @@ include(CTest)
option(WSREP_LIB_WITH_UNIT_TESTS "Compile unit tests" ON)
if (WSREP_LIB_WITH_UNIT_TESTS)
# 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()
# Build a sample program
@ -81,9 +80,9 @@ endif()
add_subdirectory(src)
add_subdirectory(wsrep-API)
if (WSREP_LIB_WITH_UNIT_TESTS)
enable_testing()
add_subdirectory(test)
endif()
if (WSREP_LIB_WITH_DBSIM)
add_subdirectory(dbsim)
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_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_ASAN - Enable address 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
wsrep-lib_test.cpp
)
target_link_libraries(wsrep-lib_test wsrep-lib)
add_test(NAME wsrep-lib_test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/wsrep-lib_test
)
add_test(NAME wsrep-lib_test
COMMAND wsrep-lib_test)
if (WSREP_LIB_WITH_AUTO_TEST)
set(UNIT_TEST wsrep-lib_test)