2021-03-28 16:58:51 +02:00
|
|
|
project(chatterino-test)
|
|
|
|
|
|
|
|
set(test_SOURCES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
2021-08-21 12:38:38 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ChannelChatters.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-24 12:01:50 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Helpers.cpp
|
2021-08-04 23:18:34 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/RatelimitBucket.cpp
|
2021-11-21 18:46:21 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Hotkeys.cpp
|
2022-02-12 15:06:47 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/UtilTwitch.cpp
|
2022-05-07 15:57:46 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/IrcHelpers.cpp
|
2022-05-07 17:22:39 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TwitchPubSubClient.cpp
|
2022-05-28 11:55:48 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TwitchMessageBuilder.cpp
|
2022-06-05 17:40:57 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/HighlightController.cpp
|
2022-05-29 13:54:42 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/FormatTime.cpp
|
2022-06-18 12:44:48 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/LimitedQueue.cpp
|
2022-10-29 14:01:01 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/BasicPubSub.cpp
|
2022-11-13 12:07:41 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/SeventvEventAPI.cpp
|
2023-01-21 15:06:55 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/BttvLiveUpdates.cpp
|
2023-01-26 19:22:48 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Updates.cpp
|
2023-04-09 23:35:06 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Filters.cpp
|
2023-04-02 16:59:26 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/LinkParser.cpp
|
2021-08-08 14:16:30 +02:00
|
|
|
# Add your new file above this line!
|
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
|
|
|
|
2022-05-22 15:43:41 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE gtest gmock)
|
2021-03-28 16:58:51 +02:00
|
|
|
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
|
2022-12-24 18:42:59 +01:00
|
|
|
if(CHATTERINO_ENABLE_LTO)
|
|
|
|
message(STATUS "Enabling LTO for ${PROJECT_NAME}")
|
|
|
|
set_property(TARGET ${PROJECT_NAME}
|
|
|
|
PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
|
|
endif()
|
|
|
|
|
2021-03-28 16:58:51 +02:00
|
|
|
# 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}
|
|
|
|
# )
|