2021-03-28 16:58:51 +02:00
|
|
|
project(chatterino-test)
|
|
|
|
|
2023-05-26 14:54:23 +02:00
|
|
|
option(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN "Use public httpbin for testing network requests" OFF)
|
|
|
|
|
2021-03-28 16:58:51 +02:00
|
|
|
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
|
2023-07-01 14:59:59 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkResult.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
|
2023-05-21 12:10:49 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/InputCompletion.cpp
|
2023-07-01 17:31:25 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Literals.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)
|
2023-05-20 12:54:50 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-mocks)
|
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()
|
|
|
|
|
2023-05-26 14:54:23 +02:00
|
|
|
if(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
|
|
|
endif()
|
|
|
|
|
2023-06-24 15:03:27 +02:00
|
|
|
gtest_discover_tests(${PROJECT_NAME})
|