add_executable(snoretoast_tests snoretoast_tests.cpp interaction_tests.cpp)
target_link_libraries(snoretoast_tests PRIVATE SnoreToast::LibSnoreToast)
target_include_directories(snoretoast_tests PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
target_compile_definitions(snoretoast_tests PRIVATE UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX)
target_compile_options(snoretoast_tests PRIVATE /utf-8)

add_test(NAME snoretoast_tests COMMAND snoretoast_tests)

option(BUILD_INTERACTIVE_TESTS "Build tests that show real notifications and require a human to interact with them" OFF)
if (BUILD_INTERACTIVE_TESTS)
    add_executable(snoretoast_interactive_tests interactive_tests.cpp)
    target_link_libraries(snoretoast_interactive_tests PRIVATE SnoreToast::LibSnoreToast)
    target_include_directories(snoretoast_interactive_tests PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
    target_compile_definitions(snoretoast_interactive_tests PRIVATE UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX)
    target_compile_options(snoretoast_interactive_tests PRIVATE /utf-8)
    add_dependencies(snoretoast_interactive_tests snoretoast)

    add_test(NAME snoretoast_interactive_tests COMMAND snoretoast_interactive_tests --snoretoast $<TARGET_FILE:snoretoast>)
    set_tests_properties(snoretoast_interactive_tests PROPERTIES LABELS interactive TIMEOUT 1800)
endif()
