mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
CMake: Create unit test
This commit is contained in:
parent
81b1e5636d
commit
3b61613d1b
2 changed files with 28 additions and 1 deletions
|
@ -33,6 +33,7 @@ option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON)
|
|||
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(USE_LTO "Use LTO for building" ON)
|
||||
option(BUILD_RPCS3_TESTS "Build RPCS3 unit tests." OFF)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Define GNU standard installation directories
|
||||
# Define GNU standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Generate git-version.h at build time.
|
||||
|
@ -214,3 +214,29 @@ if (NOT ANDROID)
|
|||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Unit tests
|
||||
if(BUILD_RPCS3_TESTS)
|
||||
enable_testing()
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
message(STATUS "Building unit tests...")
|
||||
|
||||
add_executable(rpcs3_test
|
||||
tests/test_fmt.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(rpcs3_test
|
||||
rpcs3_lib
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
target_include_directories(rpcs3_test
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(rpcs3_test)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue