# GTEST
find_package(GTest)

if(${GTEST_FOUND})
  include(GoogleTest)
  enable_testing()

  add_executable(lpc_tests test_lpc.cc)
  target_link_libraries(lpc_tests PRIVATE ${FLUFFOS_LINK} GTest::GTest  GTest::Main)
  target_compile_definitions(lpc_tests PRIVATE -DTESTSUITE_DIR="${CMAKE_SOURCE_DIR}/testsuite")

  add_executable(ofile_tests test_ofile.cc)
  target_link_libraries(ofile_tests PRIVATE ${FLUFFOS_LINK} GTest::GTest  GTest::Main)
  target_compile_definitions(ofile_tests PRIVATE -DTESTSUITE_DIR="${CMAKE_SOURCE_DIR}/testsuite")

  add_executable(terminal_tests test_terminal.cc)
  target_link_libraries(terminal_tests PRIVATE ${FLUFFOS_LINK} GTest::GTest GTest::Main)

  add_executable(strutils_tests test_strutils.cc)
  target_link_libraries(strutils_tests PRIVATE ${FLUFFOS_LINK} GTest::GTest GTest::Main)

  gtest_discover_tests(lpc_tests DISCOVERY_TIMEOUT 60)
  gtest_discover_tests(ofile_tests DISCOVERY_TIMEOUT 60)
  gtest_discover_tests(terminal_tests DISCOVERY_TIMEOUT 60)
  gtest_discover_tests(strutils_tests DISCOVERY_TIMEOUT 60)
endif()
