ci(tests): add test framework (#1603)
This commit is contained in:
parent
934f81182a
commit
89e8b9628c
43 changed files with 1519 additions and 136 deletions
|
|
@ -110,11 +110,6 @@ set(SUNSHINE_TARGET_FILES
|
|||
"${CMAKE_SOURCE_DIR}/src/stat_trackers.cpp"
|
||||
${PLATFORM_TARGET_FILES})
|
||||
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/upnp.cpp" PROPERTIES COMPILE_FLAGS -Wno-pedantic)
|
||||
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/nanors/rs.c"
|
||||
PROPERTIES COMPILE_FLAGS "-include deps/obl/autoshim.h -ftree-vectorize")
|
||||
|
||||
if(NOT SUNSHINE_ASSETS_DIR_DEF)
|
||||
set(SUNSHINE_ASSETS_DIR_DEF "${SUNSHINE_ASSETS_DIR}")
|
||||
endif()
|
||||
|
|
@ -134,15 +129,6 @@ include_directories(
|
|||
${PLATFORM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
|
||||
if(WIN32)
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp" PROPERTIES COMPILE_FLAGS -O2)
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DNDEBUG)
|
||||
endif()
|
||||
|
||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
${MINIUPNP_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
|
|
|
|||
|
|
@ -29,16 +29,6 @@ file(GLOB NVPREFS_FILES CONFIGURE_DEPENDS
|
|||
|
||||
# vigem
|
||||
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp"
|
||||
PROPERTIES COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650")
|
||||
set(VIGEM_COMPILE_FLAGS "")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unknown-pragmas ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-misleading-indentation ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-class-memaccess ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-function ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-variable ")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp"
|
||||
PROPERTIES COMPILE_FLAGS ${VIGEM_COMPILE_FLAGS})
|
||||
|
||||
# sunshine icon
|
||||
if(NOT DEFINED SUNSHINE_ICON_PATH)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
option(BUILD_TESTS "Build tests" ON)
|
||||
option(TESTS_ENABLE_PYTHON_TESTS "Enable Python tests" ON)
|
||||
|
||||
# DirectX11 is not available in GitHub runners, so even software encoding fails
|
||||
set(TESTS_SOFTWARE_ENCODER_UNAVAILABLE "fail"
|
||||
CACHE STRING "How to handle unavailable software encoders in tests. 'fail/skip'")
|
||||
|
||||
option(BUILD_WERROR "Enable -Werror flag." OFF)
|
||||
|
||||
# if this option is set, the build will exit after configuring special package configuration files
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ elseif (UNIX)
|
|||
# configure the flatpak manifest
|
||||
if(${SUNSHINE_CONFIGURE_FLATPAK_MAN})
|
||||
configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY)
|
||||
file(COPY packaging/linux/flatpak/deps/ DESTINATION ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -53,3 +53,45 @@ add_custom_target(web-ui ALL
|
|||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
COMMENT "Installing NPM Dependencies and Building the Web UI"
|
||||
COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301
|
||||
|
||||
# tests
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# custom compile flags, must be after adding tests
|
||||
|
||||
# src/upnp
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/upnp.cpp"
|
||||
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
|
||||
PROPERTIES COMPILE_FLAGS -Wno-pedantic)
|
||||
|
||||
# third-party/nanors
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/nanors/rs.c"
|
||||
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
|
||||
PROPERTIES COMPILE_FLAGS "-include deps/obl/autoshim.h -ftree-vectorize")
|
||||
|
||||
# third-party/ViGEmClient
|
||||
set(VIGEM_COMPILE_FLAGS "")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unknown-pragmas ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-misleading-indentation ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-class-memaccess ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-function ")
|
||||
string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-variable ")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp"
|
||||
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650"
|
||||
COMPILE_FLAGS ${VIGEM_COMPILE_FLAGS})
|
||||
|
||||
# src/nvhttp
|
||||
string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
|
||||
if(WIN32)
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
|
||||
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
|
||||
PROPERTIES COMPILE_FLAGS -O2)
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DNDEBUG)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue