cmake_minimum_required(VERSION 3.20)
project(lumacs_tests)

# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Add includes
include_directories(${CMAKE_SOURCE_DIR}/include)

# Google Test targets are now globally available from the root CMakeLists.txt
# No need for find_package(GTest) here.

# Build tests executable
add_executable(test_runner
    test_buffer.cpp
    test_editor_core.cpp
    test_input_pipeline.cpp
    test_buffer_manager.cpp
    test_window.cpp
    test_window_manager.cpp
    test_integration.cpp
    test_kill_ring_manager.cpp
    test_register_manager.cpp
    test_macro_manager.cpp
    test_rectangle_manager.cpp
    test_command_system.cpp
    test_lua_api.cpp
)

target_link_libraries(test_runner PRIVATE
    lumacs_core
    GTest::gtest_main
)

# Automatically discover and register tests
include(GoogleTest)
gtest_discover_tests(test_runner)