-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathCMakeLists.txt
42 lines (35 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.8.2)
# List all files containing tests. (Change as needed)
set(TESTFILES # All .cpp files in tests/
main.cpp
# delta_parser.cpp
# bitmexws.cpp
# bitmexhttp.cpp
# bitmex_gateway.cpp
# market_filtration.cpp
# fair_value.cpp
# quoting_strategies.cpp
# rounding.cpp
# quoting_engine.cpp
# skew.cpp
)
set(TEST_MAIN unit_tests) # Default name for test executable (change if you wish).
set(TEST_RUNNER_PARAMS "") # Any arguemnts to feed the test runner (change as needed).
# --------------------------------------------------------------------------------
# Make Tests (no change needed).
# --------------------------------------------------------------------------------
add_executable(${TEST_MAIN} ${TESTFILES})
target_link_libraries(${TEST_MAIN} PRIVATE ${LIBRARY_NAME} doctest)
set_target_properties(${TEST_MAIN} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
target_set_warnings(${TEST_MAIN} ENABLE ALL AS_ERROR ALL DISABLE Annoying) # Set warnings (if needed).
set_target_properties(${TEST_MAIN} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
add_test(
# Use some per-module/project prefix so that it is easier to run only tests for this module
NAME ${LIBRARY_NAME}.${TEST_MAIN}
COMMAND ${TEST_MAIN} ${TEST_RUNNER_PARAMS})
# Adds a 'coverage' target.
include(CodeCoverage)