include(ECMAddTests)

find_package(Qt5Test ${QT_MIN_VERSION} REQUIRED NO_MODULE)

include_directories(${CMAKE_SOURCE_DIR}/src)

set(tested_SRCS
    ${CMAKE_SOURCE_DIR}/src/lap.cpp
    ${CMAKE_SOURCE_DIR}/src/session.cpp
    ${CMAKE_SOURCE_DIR}/src/stopwatch.cpp
    ${CMAKE_SOURCE_DIR}/src/timeformat.cpp)

add_library(autotests STATIC ${tested_SRCS})
target_link_libraries(autotests Qt5::Core)

ecm_add_tests(
    testlap.cpp
    testsession.cpp
    teststopwatch.cpp
    testtimeformat.cpp
    LINK_LIBRARIES autotests Qt5::Test)
