2021-03-28 16:58:51 +02:00
|
|
|
project(chatterino-test)
|
|
|
|
|
|
|
|
set(test_SOURCES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
2021-05-01 17:19:41 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/AccessGuard.cpp
|
2021-04-17 13:49:19 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkCommon.cpp
|
2021-03-28 16:58:51 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkRequest.cpp
|
2021-05-24 12:13:59 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ChatterSet.cpp
|
2021-03-28 16:58:51 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/HighlightPhrase.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Emojis.cpp
|
2021-06-20 15:29:52 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ExponentialBackoff.cpp
|
2021-07-18 12:14:01 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TwitchAccount.cpp
|
2021-03-28 16:58:51 +02:00
|
|
|
)
|
|
|
|
|
2021-06-13 13:49:59 +02:00
|
|
|
add_executable(${PROJECT_NAME} ${test_SOURCES})
|
2021-04-10 13:26:20 +02:00
|
|
|
add_sanitizers(${PROJECT_NAME})
|
2021-03-28 16:58:51 +02:00
|
|
|
|
2021-06-13 13:49:59 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
|
2021-03-28 16:58:51 +02:00
|
|
|
|
2021-06-13 13:49:59 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE gtest)
|
2021-03-28 16:58:51 +02:00
|
|
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
CHATTERINO_TEST
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
)
|
|
|
|
|
|
|
|
# gtest_add_tests manages to discover the tests because it looks through the source files
|
|
|
|
# HOWEVER, it fails to run, because we have some bug that causes the QApplication exit to stall when no network requests have been made.
|
|
|
|
# ctest runs each test individually, so for now we require that testers just run the ./bin/chatterino-test binary without any filters applied
|
|
|
|
# gtest_add_tests(
|
|
|
|
# TARGET ${PROJECT_NAME}
|
|
|
|
# SOURCES ${test_SOURCES}
|
|
|
|
# )
|