mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
99b537ffd9
* EmptyApplication: Add asserts to rest of getters (except for getSeventvAPI) * Theme: make getTheme call getIApp()->getThemes() instead this allows it to be used in tests realistically this should be deprecated & users of it should just call getIApp()->getThemes() directly * Use getIApp() instead of getApp() in a few places
76 lines
3 KiB
CMake
76 lines
3 KiB
CMake
project(chatterino-test)
|
|
|
|
option(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN "Use public httpbin for testing network requests" OFF)
|
|
|
|
set(test_SOURCES
|
|
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/resources/test-resources.qrc
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TestHelpers.hpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ChannelChatters.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/AccessGuard.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkCommon.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkRequest.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NetworkResult.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ChatterSet.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/HighlightPhrase.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Emojis.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/ExponentialBackoff.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Helpers.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/RatelimitBucket.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Hotkeys.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/UtilTwitch.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/IrcHelpers.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TwitchPubSubClient.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/TwitchMessageBuilder.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/HighlightController.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/FormatTime.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/LimitedQueue.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/BasicPubSub.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/SeventvEventAPI.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/BttvLiveUpdates.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Updates.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Filters.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/LinkParser.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/InputCompletion.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Literals.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/XDGDesktopFile.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/XDGHelper.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/Selection.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/src/NotebookTab.cpp
|
|
# Add your new file above this line!
|
|
)
|
|
|
|
add_executable(${PROJECT_NAME} ${test_SOURCES})
|
|
add_sanitizers(${PROJECT_NAME})
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-mocks)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE gtest gmock)
|
|
|
|
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"
|
|
)
|
|
|
|
if(CHATTERINO_ENABLE_LTO)
|
|
message(STATUS "Enabling LTO for ${PROJECT_NAME}")
|
|
set_property(TARGET ${PROJECT_NAME}
|
|
PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
endif()
|
|
|
|
if(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
|
endif()
|
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
PROPERTIES
|
|
AUTORCC ON
|
|
)
|
|
|
|
gtest_discover_tests(${PROJECT_NAME})
|