mirror-chatterino2/tests/CMakeLists.txt
James Upjohn d2b89f028b
feat: improve @Mm2PL's CI splitting work (#3631)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
Co-authored-by: Paweł <zneix@zneix.eu>
Co-authored-by: Leon Richardt <leon.richardt@gmail.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: James Upjohn <jammehcow@jammehcow.co.nz>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: qooq69 <52359859+qooq69@users.noreply.github.com>
Co-authored-by: karl-police <karl-police2001@bluewin.ch>
Co-authored-by: Patrick Geneva <goldbattle@users.noreply.github.com>
Co-authored-by: Infinitay <Infinitay@users.noreply.github.com>
Co-authored-by: Mm2PL <miau@mail.kotmisia.pl>
Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
Co-authored-by: ooxi <violetland@mail.ru>
Co-authored-by: Edgar <Edgar@AnotherFoxGuy.com>
Co-authored-by: Brian <18603393+brian6932@users.noreply.github.com>
Co-authored-by: oldLucke <oldlucke@gmail.com>
Co-authored-by: nerix <nero.9@hotmail.de>
2022-03-30 18:20:18 +00:00

48 lines
1.9 KiB
CMake

project(chatterino-test)
set(test_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
${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/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/TwitchAccount.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
# 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 gtest)
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}
# )