diff options
| author | 2023-01-22 18:22:47 -0500 | |
|---|---|---|
| committer | 2023-01-22 18:22:47 -0500 | |
| commit | f99f618d45ad862c4bc23fc28c91d1c48218a3cb (patch) | |
| tree | ec7b1205207b6c177af1bad768119e713b30138d | |
| parent | Merge pull request #9660 from german77/koreaToTaiwan (diff) | |
| parent | cmake: support the standard cmake testing option (diff) | |
| download | yuzu-f99f618d45ad862c4bc23fc28c91d1c48218a3cb.tar.gz yuzu-f99f618d45ad862c4bc23fc28c91d1c48218a3cb.tar.xz yuzu-f99f618d45ad862c4bc23fc28c91d1c48218a3cb.zip | |
Merge pull request #9555 from abouvier/catch2-update
tests: update catch2 to 3.0.1
| -rw-r--r-- | CMakeLists.txt | 11 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/tests/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/tests/common/bit_field.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/cityhash.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/fibers.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/host_memory.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/param_package.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/range_map.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/ring_buffer.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/scratch_buffer.cpp | 2 | ||||
| -rw-r--r-- | src/tests/common/unique_function.cpp | 2 | ||||
| -rw-r--r-- | src/tests/core/core_timing.cpp | 2 | ||||
| -rw-r--r-- | src/tests/core/internal_network/network.cpp | 2 | ||||
| -rw-r--r-- | src/tests/input_common/calibration_configuration_job.cpp | 2 | ||||
| -rw-r--r-- | src/tests/tests.cpp | 8 | ||||
| -rw-r--r-- | src/tests/video_core/buffer_base.cpp | 2 | ||||
| -rw-r--r-- | vcpkg.json | 2 |
18 files changed, 24 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cee720940..f91ba950a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -3,12 +3,14 @@ | |||
| 3 | 3 | ||
| 4 | cmake_minimum_required(VERSION 3.22) | 4 | cmake_minimum_required(VERSION 3.22) |
| 5 | 5 | ||
| 6 | project(yuzu) | ||
| 7 | |||
| 6 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") | 8 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") |
| 7 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") | 9 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") |
| 10 | |||
| 8 | include(DownloadExternals) | 11 | include(DownloadExternals) |
| 9 | include(CMakeDependentOption) | 12 | include(CMakeDependentOption) |
| 10 | 13 | include(CTest) | |
| 11 | project(yuzu) | ||
| 12 | 14 | ||
| 13 | # Set bundled sdl2/qt as dependent options. | 15 | # Set bundled sdl2/qt as dependent options. |
| 14 | # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON | 16 | # 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) | |||
| 42 | 44 | ||
| 43 | option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) | 45 | option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) |
| 44 | 46 | ||
| 45 | option(YUZU_TESTS "Compile tests" ON) | 47 | option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}") |
| 46 | 48 | ||
| 47 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) | 49 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) |
| 48 | 50 | ||
| @@ -242,7 +244,7 @@ if (ENABLE_WEB_SERVICE) | |||
| 242 | endif() | 244 | endif() |
| 243 | 245 | ||
| 244 | if (YUZU_TESTS) | 246 | if (YUZU_TESTS) |
| 245 | find_package(Catch2 2.13.7 REQUIRED) | 247 | find_package(Catch2 3.0.1 REQUIRED) |
| 246 | endif() | 248 | endif() |
| 247 | 249 | ||
| 248 | find_package(Boost 1.73.0 COMPONENTS context) | 250 | find_package(Boost 1.73.0 COMPONENTS context) |
| @@ -606,7 +608,6 @@ if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | |||
| 606 | endif() | 608 | endif() |
| 607 | endif() | 609 | endif() |
| 608 | 610 | ||
| 609 | enable_testing() | ||
| 610 | add_subdirectory(externals) | 611 | add_subdirectory(externals) |
| 611 | add_subdirectory(src) | 612 | add_subdirectory(src) |
| 612 | 613 | ||
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 89a381587..94dd8bb62 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | # some of its variables, which is only possible in 3.13+ | 5 | # some of its variables, which is only possible in 3.13+ |
| 6 | set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) | 6 | set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) |
| 7 | 7 | ||
| 8 | # Disable tests in all externals supporting the standard option name | ||
| 9 | set(BUILD_TESTING OFF) | ||
| 10 | |||
| 8 | # xbyak | 11 | # xbyak |
| 9 | if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) | 12 | if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) |
| 10 | add_subdirectory(xbyak EXCLUDE_FROM_ALL) | 13 | add_subdirectory(xbyak EXCLUDE_FROM_ALL) |
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 9b65e79cb..ae84408bc 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt | |||
| @@ -14,7 +14,6 @@ add_executable(tests | |||
| 14 | core/core_timing.cpp | 14 | core/core_timing.cpp |
| 15 | core/internal_network/network.cpp | 15 | core/internal_network/network.cpp |
| 16 | precompiled_headers.h | 16 | precompiled_headers.h |
| 17 | tests.cpp | ||
| 18 | video_core/buffer_base.cpp | 17 | video_core/buffer_base.cpp |
| 19 | input_common/calibration_configuration_job.cpp | 18 | input_common/calibration_configuration_job.cpp |
| 20 | ) | 19 | ) |
| @@ -22,7 +21,7 @@ add_executable(tests | |||
| 22 | create_target_directory_groups(tests) | 21 | create_target_directory_groups(tests) |
| 23 | 22 | ||
| 24 | target_link_libraries(tests PRIVATE common core input_common) | 23 | target_link_libraries(tests PRIVATE common core input_common) |
| 25 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2 Threads::Threads) | 24 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2WithMain Threads::Threads) |
| 26 | 25 | ||
| 27 | add_test(NAME tests COMMAND tests) | 26 | add_test(NAME tests COMMAND tests) |
| 28 | 27 | ||
diff --git a/src/tests/common/bit_field.cpp b/src/tests/common/bit_field.cpp index 0071ae52e..75e990ecd 100644 --- a/src/tests/common/bit_field.cpp +++ b/src/tests/common/bit_field.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <array> | 4 | #include <array> |
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include <type_traits> | 6 | #include <type_traits> |
| 7 | #include <catch2/catch.hpp> | 7 | #include <catch2/catch_test_macros.hpp> |
| 8 | #include "common/bit_field.h" | 8 | #include "common/bit_field.h" |
| 9 | 9 | ||
| 10 | TEST_CASE("BitField", "[common]") { | 10 | TEST_CASE("BitField", "[common]") { |
diff --git a/src/tests/common/cityhash.cpp b/src/tests/common/cityhash.cpp index 05942eadb..2a391dff1 100644 --- a/src/tests/common/cityhash.cpp +++ b/src/tests/common/cityhash.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch_test_macros.hpp> |
| 5 | 5 | ||
| 6 | #include "common/cityhash.h" | 6 | #include "common/cityhash.h" |
| 7 | 7 | ||
diff --git a/src/tests/common/fibers.cpp b/src/tests/common/fibers.cpp index 4e29f9199..ecad7583f 100644 --- a/src/tests/common/fibers.cpp +++ b/src/tests/common/fibers.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include <unordered_map> | 11 | #include <unordered_map> |
| 12 | #include <vector> | 12 | #include <vector> |
| 13 | 13 | ||
| 14 | #include <catch2/catch.hpp> | 14 | #include <catch2/catch_test_macros.hpp> |
| 15 | 15 | ||
| 16 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 17 | #include "common/fiber.h" | 17 | #include "common/fiber.h" |
diff --git a/src/tests/common/host_memory.cpp b/src/tests/common/host_memory.cpp index e49d0a09f..1b014b632 100644 --- a/src/tests/common/host_memory.cpp +++ b/src/tests/common/host_memory.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch_test_macros.hpp> |
| 5 | 5 | ||
| 6 | #include "common/host_memory.h" | 6 | #include "common/host_memory.h" |
| 7 | #include "common/literals.h" | 7 | #include "common/literals.h" |
diff --git a/src/tests/common/param_package.cpp b/src/tests/common/param_package.cpp index d036cc83a..41575def4 100644 --- a/src/tests/common/param_package.cpp +++ b/src/tests/common/param_package.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch_test_macros.hpp> |
| 5 | #include <math.h> | 5 | #include <math.h> |
| 6 | #include "common/logging/backend.h" | 6 | #include "common/logging/backend.h" |
| 7 | #include "common/param_package.h" | 7 | #include "common/param_package.h" |
diff --git a/src/tests/common/range_map.cpp b/src/tests/common/range_map.cpp index 5a4630a38..d301ac5f6 100644 --- a/src/tests/common/range_map.cpp +++ b/src/tests/common/range_map.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <stdexcept> | 4 | #include <stdexcept> |
| 5 | 5 | ||
| 6 | #include <catch2/catch.hpp> | 6 | #include <catch2/catch_test_macros.hpp> |
| 7 | 7 | ||
| 8 | #include "common/range_map.h" | 8 | #include "common/range_map.h" |
| 9 | 9 | ||
diff --git a/src/tests/common/ring_buffer.cpp b/src/tests/common/ring_buffer.cpp index 4f81b6e5e..7dee988c8 100644 --- a/src/tests/common/ring_buffer.cpp +++ b/src/tests/common/ring_buffer.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include <numeric> | 7 | #include <numeric> |
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | #include <vector> | 9 | #include <vector> |
| 10 | #include <catch2/catch.hpp> | 10 | #include <catch2/catch_test_macros.hpp> |
| 11 | #include "common/ring_buffer.h" | 11 | #include "common/ring_buffer.h" |
| 12 | 12 | ||
| 13 | namespace Common { | 13 | namespace Common { |
diff --git a/src/tests/common/scratch_buffer.cpp b/src/tests/common/scratch_buffer.cpp index f6e50da4a..132f139fa 100644 --- a/src/tests/common/scratch_buffer.cpp +++ b/src/tests/common/scratch_buffer.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <array> | 5 | #include <array> |
| 6 | #include <cstring> | 6 | #include <cstring> |
| 7 | #include <span> | 7 | #include <span> |
| 8 | #include <catch2/catch.hpp> | 8 | #include <catch2/catch_test_macros.hpp> |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/scratch_buffer.h" | 10 | #include "common/scratch_buffer.h" |
| 11 | 11 | ||
diff --git a/src/tests/common/unique_function.cpp b/src/tests/common/unique_function.cpp index 311272506..f7a23e876 100644 --- a/src/tests/common/unique_function.cpp +++ b/src/tests/common/unique_function.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <string> | 4 | #include <string> |
| 5 | 5 | ||
| 6 | #include <catch2/catch.hpp> | 6 | #include <catch2/catch_test_macros.hpp> |
| 7 | 7 | ||
| 8 | #include "common/unique_function.h" | 8 | #include "common/unique_function.h" |
| 9 | 9 | ||
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 284b2ae66..f08afbf9a 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2016 Dolphin Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch_test_macros.hpp> |
| 5 | 5 | ||
| 6 | #include <array> | 6 | #include <array> |
| 7 | #include <bitset> | 7 | #include <bitset> |
diff --git a/src/tests/core/internal_network/network.cpp b/src/tests/core/internal_network/network.cpp index 164b0ff24..10ddd8b42 100644 --- a/src/tests/core/internal_network/network.cpp +++ b/src/tests/core/internal_network/network.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch_test_macros.hpp> |
| 5 | 5 | ||
| 6 | #include "core/internal_network/network.h" | 6 | #include "core/internal_network/network.h" |
| 7 | #include "core/internal_network/sockets.h" | 7 | #include "core/internal_network/sockets.h" |
diff --git a/src/tests/input_common/calibration_configuration_job.cpp b/src/tests/input_common/calibration_configuration_job.cpp index e5f698886..516ff1b30 100644 --- a/src/tests/input_common/calibration_configuration_job.cpp +++ b/src/tests/input_common/calibration_configuration_job.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include <thread> | 6 | #include <thread> |
| 7 | #include <boost/asio.hpp> | 7 | #include <boost/asio.hpp> |
| 8 | #include <boost/crc.hpp> | 8 | #include <boost/crc.hpp> |
| 9 | #include <catch2/catch.hpp> | 9 | #include <catch2/catch_test_macros.hpp> |
| 10 | 10 | ||
| 11 | #include "input_common/drivers/udp_client.h" | 11 | #include "input_common/drivers/udp_client.h" |
| 12 | #include "input_common/helpers/udp_protocol.h" | 12 | #include "input_common/helpers/udp_protocol.h" |
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp deleted file mode 100644 index 3f905c05c..000000000 --- a/src/tests/tests.cpp +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #define CATCH_CONFIG_MAIN | ||
| 5 | #include <catch2/catch.hpp> | ||
| 6 | |||
| 7 | // Catch provides the main function since we've given it the | ||
| 8 | // CATCH_CONFIG_MAIN preprocessor directive. | ||
diff --git a/src/tests/video_core/buffer_base.cpp b/src/tests/video_core/buffer_base.cpp index 5cd0628f2..1275cca24 100644 --- a/src/tests/video_core/buffer_base.cpp +++ b/src/tests/video_core/buffer_base.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <stdexcept> | 4 | #include <stdexcept> |
| 5 | #include <unordered_map> | 5 | #include <unordered_map> |
| 6 | 6 | ||
| 7 | #include <catch2/catch.hpp> | 7 | #include <catch2/catch_test_macros.hpp> |
| 8 | 8 | ||
| 9 | #include "common/alignment.h" | 9 | #include "common/alignment.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
diff --git a/vcpkg.json b/vcpkg.json index 3c92510d6..ef271f778 100644 --- a/vcpkg.json +++ b/vcpkg.json | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | "overrides": [ | 40 | "overrides": [ |
| 41 | { | 41 | { |
| 42 | "name": "catch2", | 42 | "name": "catch2", |
| 43 | "version": "2.13.9" | 43 | "version": "3.0.1" |
| 44 | }, | 44 | }, |
| 45 | { | 45 | { |
| 46 | "name": "fmt", | 46 | "name": "fmt", |