Skip to content

Commit aa3e18a

Browse files
authored
Merge pull request #163 from Point72/tkp/cpptests
Re-enable C++ testing
2 parents 7ff7719 + f3065f4 commit aa3e18a

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,19 @@ checks: check
7979
#########
8080
# TESTS #
8181
#########
82-
.PHONY: test-py coverage-py test tests
82+
.PHONY: test-py test-cpp coverage-py test tests
8383

8484
TEST_ARGS :=
8585
test-py: ## Clean and Make unit tests
8686
python -m pytest -v csp/tests --junitxml=junit.xml $(TEST_ARGS)
8787

88+
test-cpp: ## Make C++ unit tests
89+
for f in ./csp/tests/bin/*; do $$f; done || (echo "TEST FAILED" && exit 1)
90+
8891
coverage-py:
8992
python -m pytest -v csp/tests --junitxml=junit.xml --cov=csp --cov-report xml --cov-report html --cov-branch --cov-fail-under=80 --cov-report term-missing $(TEST_ARGS)
9093

91-
test: test-py ## run the tests
94+
test: test-cpp test-py ## run the tests
9295

9396
# Alias
9497
tests: test

conda/dev-environment-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- exprtk
1414
- flex
1515
- python-graphviz
16+
- gtest
1617
- httpx
1718
- isort
1819
- libarrow=15

cpp/tests/core/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
find_library(GTest REQUIRED)
1+
find_package(GTest CONFIG REQUIRED)
22

33
add_executable(test_basic_allocator test_basic_allocator.cpp)
44
target_link_libraries(test_basic_allocator GTest::gtest GTest::gtest_main)
55

66
add_executable(test_dynamicbitset test_dynamicbitset.cpp)
7-
target_link_libraries(test_dynamicbitset gtest gtest_main)
7+
target_link_libraries(test_dynamicbitset GTest::gtest GTest::gtest_main)
88

99
add_executable(test_enum test_enum.cpp)
1010
target_link_libraries(test_enum csp_core csp_engine GTest::gtest GTest::gtest_main)
@@ -16,7 +16,7 @@ add_executable(test_tagged_pointer_union test_tagged_pointer_union.cpp )
1616
target_link_libraries(test_tagged_pointer_union csp_core GTest::gtest GTest::gtest_main)
1717

1818
add_executable(test_time test_time.cpp )
19-
target_link_libraries(test_time csp_core GTest::gtest GTest::gtest_main rt)
19+
target_link_libraries(test_time csp_core GTest::gtest GTest::gtest_main)
2020

2121

2222
install(TARGETS test_basic_allocator

cpp/tests/engine/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
find_library(GTest REQUIRED)
1+
find_package(GTest CONFIG REQUIRED)
22

33
add_executable(test_dictionary test_dictionary.cpp )
4-
target_link_libraries(test_dictionary csp_engine GTest::gtest GTest::gtest_main rt)
4+
target_link_libraries(test_dictionary csp_engine GTest::gtest GTest::gtest_main)
55

66
add_executable(test_tick_buffer test_tick_buffer.cpp)
77
target_link_libraries(test_tick_buffer csp_engine GTest::gtest GTest::gtest_main)
88

99
add_executable(test_time_series test_time_series.cpp)
10-
target_link_libraries(test_time_series csp_engine_static gtest gtest_main pthread)
10+
target_link_libraries(test_time_series csp_engine GTest::gtest GTest::gtest_main pthread)
1111

1212
add_executable(test_partial_switch_csp_type test_partial_switch_csp_type.cpp)
1313
target_link_libraries(test_partial_switch_csp_type csp_engine GTest::gtest GTest::gtest_main)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
CSP_USE_VCPKG = os.environ.get("CSP_USE_VCPKG", "1").lower() in ("1", "on")
1212
CMAKE_OPTIONS = (
1313
("CSP_BUILD_NO_CXX_ABI", "0"),
14-
("CSP_BUILD_TESTS", "0"),
14+
("CSP_BUILD_TESTS", "1"),
1515
("CSP_MANYLINUX", "0"),
1616
("CSP_BUILD_KAFKA_ADAPTER", "1"),
1717
("CSP_BUILD_PARQUET_ADAPTER", "1"),

0 commit comments

Comments
 (0)