test: Migrate unit tests to gtest, integrate with CI (#2144)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(crosspoint_reader_tests CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG v1.17.0
|
||||
)
|
||||
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
|
||||
set(REPO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
|
||||
add_library(crosspoint_test_common INTERFACE)
|
||||
target_include_directories(crosspoint_test_common INTERFACE
|
||||
${REPO_ROOT}
|
||||
${REPO_ROOT}/lib
|
||||
)
|
||||
target_compile_options(crosspoint_test_common INTERFACE
|
||||
-Wall
|
||||
-Wextra
|
||||
-pedantic
|
||||
)
|
||||
|
||||
enable_testing()
|
||||
include(GoogleTest)
|
||||
|
||||
add_subdirectory(streaming_json_parser)
|
||||
add_subdirectory(release_json_parser)
|
||||
add_subdirectory(differential_rounding)
|
||||
add_subdirectory(hyphenation_eval)
|
||||
Reference in New Issue
Block a user