cmake_minimum_required(VERSION 3.15)
project(zonoopt_unit_tests)

include(GoogleTest)

function(create_test TEST_NAME SOURCE)
    add_executable(${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/cpp-tests/src/${SOURCE})
    target_link_libraries(${TEST_NAME} PRIVATE ZonoOpt GTest::gtest_main)
    target_include_directories(${TEST_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cpp-tests/include)
    target_compile_definitions(${TEST_NAME} PRIVATE TEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test-data")
    gtest_discover_tests(${TEST_NAME})
endfunction()

# tests
create_test(test_get_leaves "test_get_leaves.cpp")
create_test(test_safety_verification "test_safety_verification.cpp")
create_test(test_vrep_2_hybzono "test_vrep_2_hybzono.cpp")
create_test(test_minkowski_sum "test_minkowski_sum.cpp")
create_test(test_intersection "test_intersection.cpp")
create_test(test_is_empty "test_is_empty.cpp")
create_test(test_support "test_support.cpp")
create_test(test_point_contain "test_point_contain.cpp")
create_test(test_interval_arithmetic "test_interval_arithmetic.cpp")
create_test(test_affine_inclusion "test_affine_inclusion.cpp")
create_test(test_operator_overloading "test_operator_overloading.cpp")
create_test(test_remove_redundancy "test_remove_redundancy.cpp")
create_test(test_json "test_json.cpp")
create_test(test_overapproximation "test_overapproximation.cpp")
create_test(test_zono_hull "test_zono_hull.cpp")
