find_package(GTest REQUIRED)

# Third Party
include_directories(${GTEST_INCLUDE_DIR})

link_directories(${GTEST_LIB_DIR})

# tests
file(GLOB_RECURSE TEST_SOURCES "*.cpp" "*.c")
add_executable(tests)

target_sources(tests
    PRIVATE
    ${TEST_SOURCES}
    ../project/Core/Src/tftp.c
)

target_compile_options(tests PRIVATE $<$<CONFIG:Debug>:
    -Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
    >)
target_link_libraries(tests
    PRIVATE
    gtest
    GTest::gtest_main
)

target_include_directories(tests
    PUBLIC
    ${CMAKE_CURRENT_LIST_DIR}
    ${PROJECT_BINARY_DIR}
    ../project/Core/Inc/
)

include(GoogleTest)
gtest_discover_tests(tests)