file(GLOB TEST_SOURCES "test_*.cpp")

set(TEST_LIBS gtest_main leetcode)

foreach (TEST_SRC ${TEST_SOURCES})
    get_filename_component(TEST_NAME ${TEST_SRC} NAME_WE)

    add_executable(${TEST_NAME} ${TEST_SRC})
    target_link_libraries(${TEST_NAME} PUBLIC ${TEST_LIBS})

    add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
endforeach ()