CMake: Run unit test during build if requested
This commit is contained in:
@@ -34,6 +34,7 @@ option(USE_SYSTEM_OPENCV "Prefer system OpenCV instead of the builtin one" ON)
|
|||||||
option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF)
|
option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF)
|
||||||
option(USE_LTO "Use LTO for building" ON)
|
option(USE_LTO "Use LTO for building" ON)
|
||||||
option(BUILD_RPCS3_TESTS "Build RPCS3 unit tests." OFF)
|
option(BUILD_RPCS3_TESTS "Build RPCS3 unit tests." OFF)
|
||||||
|
option(RUN_RPCS3_TESTS "Run RPCS3 unit tests. Requires BUILD_RPCS3_TESTS" OFF)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
|
||||||
|
|
||||||
|
|||||||
@@ -239,4 +239,12 @@ if(BUILD_RPCS3_TESTS)
|
|||||||
|
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
gtest_discover_tests(rpcs3_test)
|
gtest_discover_tests(rpcs3_test)
|
||||||
|
|
||||||
|
if(RUN_RPCS3_TESTS)
|
||||||
|
add_custom_target(run_tests
|
||||||
|
ALL
|
||||||
|
COMMAND ${CMAKE_CTEST_COMMAND} -j -VV --output-on-failure
|
||||||
|
DEPENDS rpcs3_test
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user