yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #9555 from abouvier/catch2-update

tests: update catch2 to 3.0.1
This commit is contained in:
liamwhite 2023-01-22 18:22:47 -05:00 committed by GitHub
commit f99f618d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 24 additions and 29 deletions

View File

@ -3,12 +3,14 @@
cmake_minimum_required(VERSION 3.22) cmake_minimum_required(VERSION 3.22)
project(yuzu)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
include(DownloadExternals) include(DownloadExternals)
include(CMakeDependentOption) include(CMakeDependentOption)
include(CTest)
project(yuzu)
# Set bundled sdl2/qt as dependent options. # Set bundled sdl2/qt as dependent options.
# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
@ -42,7 +44,7 @@ option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
option(YUZU_TESTS "Compile tests" ON) option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
@ -242,7 +244,7 @@ if (ENABLE_WEB_SERVICE)
endif() endif()
if (YUZU_TESTS) if (YUZU_TESTS)
find_package(Catch2 2.13.7 REQUIRED) find_package(Catch2 3.0.1 REQUIRED)
endif() endif()
find_package(Boost 1.73.0 COMPONENTS context) find_package(Boost 1.73.0 COMPONENTS context)
@ -606,7 +608,6 @@ if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif() endif()
endif() endif()
enable_testing()
add_subdirectory(externals) add_subdirectory(externals)
add_subdirectory(src) add_subdirectory(src)

View File

@ -5,6 +5,9 @@
# some of its variables, which is only possible in 3.13+ # some of its variables, which is only possible in 3.13+
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# Disable tests in all externals supporting the standard option name
set(BUILD_TESTING OFF)
# xbyak # xbyak
if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak)
add_subdirectory(xbyak EXCLUDE_FROM_ALL) add_subdirectory(xbyak EXCLUDE_FROM_ALL)

View File

@ -14,7 +14,6 @@ add_executable(tests
core/core_timing.cpp core/core_timing.cpp
core/internal_network/network.cpp core/internal_network/network.cpp
precompiled_headers.h precompiled_headers.h
tests.cpp
video_core/buffer_base.cpp video_core/buffer_base.cpp
input_common/calibration_configuration_job.cpp input_common/calibration_configuration_job.cpp
) )
@ -22,7 +21,7 @@ add_executable(tests
create_target_directory_groups(tests) create_target_directory_groups(tests)
target_link_libraries(tests PRIVATE common core input_common) target_link_libraries(tests PRIVATE common core input_common)
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2 Threads::Threads) target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2WithMain Threads::Threads)
add_test(NAME tests COMMAND tests) add_test(NAME tests COMMAND tests)

View File

@ -4,7 +4,7 @@
#include <array> #include <array>
#include <cstring> #include <cstring>
#include <type_traits> #include <type_traits>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/bit_field.h" #include "common/bit_field.h"
TEST_CASE("BitField", "[common]") { TEST_CASE("BitField", "[common]") {

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/cityhash.h" #include "common/cityhash.h"

View File

@ -11,7 +11,7 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/fiber.h" #include "common/fiber.h"

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/host_memory.h" #include "common/host_memory.h"
#include "common/literals.h" #include "common/literals.h"

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2017 Citra Emulator Project // SPDX-FileCopyrightText: 2017 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include <math.h> #include <math.h>
#include "common/logging/backend.h" #include "common/logging/backend.h"
#include "common/param_package.h" #include "common/param_package.h"

View File

@ -3,7 +3,7 @@
#include <stdexcept> #include <stdexcept>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/range_map.h" #include "common/range_map.h"

View File

@ -7,7 +7,7 @@
#include <numeric> #include <numeric>
#include <thread> #include <thread>
#include <vector> #include <vector>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/ring_buffer.h" #include "common/ring_buffer.h"
namespace Common { namespace Common {

View File

@ -5,7 +5,7 @@
#include <array> #include <array>
#include <cstring> #include <cstring>
#include <span> #include <span>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/scratch_buffer.h" #include "common/scratch_buffer.h"

View File

@ -3,7 +3,7 @@
#include <string> #include <string>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/unique_function.h" #include "common/unique_function.h"

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2016 Dolphin Emulator Project // SPDX-FileCopyrightText: 2016 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include <array> #include <array>
#include <bitset> #include <bitset>

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "core/internal_network/network.h" #include "core/internal_network/network.h"
#include "core/internal_network/sockets.h" #include "core/internal_network/sockets.h"

View File

@ -6,7 +6,7 @@
#include <thread> #include <thread>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "input_common/drivers/udp_client.h" #include "input_common/drivers/udp_client.h"
#include "input_common/helpers/udp_protocol.h" #include "input_common/helpers/udp_protocol.h"

View File

@ -1,8 +0,0 @@
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
// Catch provides the main function since we've given it the
// CATCH_CONFIG_MAIN preprocessor directive.

View File

@ -4,7 +4,7 @@
#include <stdexcept> #include <stdexcept>
#include <unordered_map> #include <unordered_map>
#include <catch2/catch.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/alignment.h" #include "common/alignment.h"
#include "common/common_types.h" #include "common/common_types.h"

View File

@ -40,7 +40,7 @@
"overrides": [ "overrides": [
{ {
"name": "catch2", "name": "catch2",
"version": "2.13.9" "version": "3.0.1"
}, },
{ {
"name": "fmt", "name": "fmt",