libdpf/test/CMakeLists.txt
Ryan Henry e4e666f459 Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-24 14:08:32 -06:00

106 lines
4.6 KiB
CMake

cmake_minimum_required(VERSION 3.10)
project(libdpf_test)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
option(BUILD_GMOCK "Builds the googlemock subproject" OFF)
option(INSTALL_GTEST "Enable installation of googletest" OFF)
add_subdirectory(googletest)
enable_testing()
include_directories(../include ../thirdparty ../thirdparty/asio/asio/include)
link_libraries(gtest_main bsd)
add_compile_options(-march=native)
option(COVERAGE "Compile with coverage instrumentation" OFF)
if(COVERAGE)
add_compile_options(-g -O0 -fno-inline -fno-inline-small-functions -fno-default-inline -fprofile-arcs -ftest-coverage)
link_libraries(gcov)
endif()
add_executable(all_test tests/all_test.cpp)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
add_executable(dpf_key_test tests/dpf_key_test.cpp)
add_executable(wildcard_test tests/wildcard_test.cpp)
add_executable(eval_point_test tests/eval_point_test.cpp)
add_executable(eval_interval_test tests/eval_interval_test.cpp)
add_executable(eval_full_test tests/eval_full_test.cpp)
add_executable(eval_sequence_test tests/eval_sequence_test.cpp)
add_executable(eval_point_multi_test tests/eval_point_multi_test.cpp)
add_executable(eval_interval_multi_test tests/eval_interval_multi_test.cpp)
add_executable(eval_full_multi_test tests/eval_full_multi_test.cpp)
add_executable(eval_sequence_multi_test tests/eval_sequence_multi_test.cpp)
add_executable(advice_bit_iterable_test tests/advice_bit_iterable_test.cpp)
add_executable(bit_array_test tests/bit_array_test.cpp)
add_executable(parallel_bit_iterable_test tests/parallel_bit_iterable_test.cpp)
add_executable(setbit_index_iterable_test tests/setbit_index_iterable_test.cpp)
add_executable(incremental_test tests/incremental_test.cpp)
add_executable(geneval_test tests/geneval_test.cpp)
add_executable(stress_scenarios_test tests/stress_scenarios_test.cpp)
add_executable(incremental_json_test tests/incremental_json_test.cpp)
target_compile_definitions(incremental_json_test PRIVATE LIBDPF_HAS_NLOHMANN_JSON)
target_include_directories(incremental_json_test PRIVATE ../thirdparty/json/include)
add_executable(keyword2_test tests/keyword2_test.cpp)
# Patterns are compiled as constexpr automata. Length, state, and 256-bit
# boundaries exceed the default constexpr operation budget.
target_compile_options(keyword2_test PRIVATE -fconstexpr-ops-limit=100000000)
add_executable(types_test tests/types_test.cpp)
add_executable(packed_lane_test tests/packed_lane_test.cpp)
add_executable(lane_blast_test tests/lane_blast_test.cpp)
add_executable(context_blast_test tests/context_blast_test.cpp)
add_executable(random_test tests/random_test.cpp tests/random_odr_tu.cpp)
target_compile_options(random_test PRIVATE -ftrapv)
find_package(Threads REQUIRED)
target_link_libraries(random_test Threads::Threads)
add_executable(prg_lowmc_test tests/prg_lowmc_test.cpp)
add_executable(secret_share_test tests/secret_share_test.cpp)
add_executable(beaver_test tests/beaver_test.cpp)
add_executable(constant_lut_test tests/constant_lut_test.cpp)
add_executable(signed_prefix_test tests/signed_prefix_test.cpp)
add_executable(easy_lut_test tests/easy_lut_test.cpp)
add_executable(principal_lut_test tests/principal_lut_test.cpp)
add_executable(window_lut_test tests/window_lut_test.cpp)
add_executable(offset_horner_test tests/offset_horner_test.cpp)
include(GoogleTest)
gtest_discover_tests(dpf_key_test)
gtest_discover_tests(wildcard_test)
gtest_discover_tests(eval_point_test)
gtest_discover_tests(eval_interval_test)
gtest_discover_tests(eval_full_test)
gtest_discover_tests(eval_sequence_test)
gtest_discover_tests(eval_point_multi_test)
gtest_discover_tests(eval_interval_multi_test)
gtest_discover_tests(eval_full_multi_test)
gtest_discover_tests(eval_sequence_multi_test)
gtest_discover_tests(advice_bit_iterable_test)
gtest_discover_tests(bit_array_test)
gtest_discover_tests(parallel_bit_iterable_test)
gtest_discover_tests(setbit_index_iterable_test)
gtest_discover_tests(incremental_test)
gtest_discover_tests(geneval_test)
gtest_discover_tests(stress_scenarios_test)
gtest_discover_tests(incremental_json_test)
gtest_discover_tests(keyword2_test)
gtest_discover_tests(types_test)
gtest_discover_tests(packed_lane_test)
gtest_discover_tests(lane_blast_test)
gtest_discover_tests(context_blast_test)
gtest_discover_tests(random_test)
gtest_discover_tests(prg_lowmc_test)
gtest_discover_tests(secret_share_test)
gtest_discover_tests(beaver_test)
gtest_discover_tests(constant_lut_test)
gtest_discover_tests(signed_prefix_test)
gtest_discover_tests(easy_lut_test)
gtest_discover_tests(principal_lut_test)
gtest_discover_tests(window_lut_test)
gtest_discover_tests(offset_horner_test)