tests: Update to Catch2 v3

This commit is contained in:
Merry 2022-12-31 16:26:55 +00:00
parent f397c4434f
commit 31a684361f
22 changed files with 24 additions and 31 deletions

View file

@ -145,7 +145,7 @@ if (DYNARMIC_USE_LLVM)
endif()
if (DYNARMIC_TESTS)
find_package(Catch2 2 QUIET)
find_package(Catch2 3 QUIET)
if (DYNARMIC_TESTS_USE_UNICORN)
find_package(Unicorn REQUIRED)
endif()

View file

@ -11,7 +11,7 @@
#include <type_traits>
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/bit/bit_count.hpp>
#include <mcl/bit/swap.hpp>
#include <mcl/scope_exit.hpp>

View file

@ -12,7 +12,7 @@
#include <string_view>
#include <tuple>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/bit/bit_field.hpp>
#include <mcl/stdint.hpp>

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "dynarmic/frontend/A32/disassembler/disassembler.h"

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"
#include "dynarmic/frontend/A32/a32_location_descriptor.h"

View file

@ -5,7 +5,7 @@
#include <memory>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"
#include "dynarmic/frontend/A32/a32_location_descriptor.h"

View file

@ -5,7 +5,7 @@
#include <optional>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/stdint.hpp>
#include "./testenv.h"

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"
#include "dynarmic/common/fp/fpsr.h"

View file

@ -5,7 +5,7 @@
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/stdint.hpp>
#include "./testenv.h"

View file

@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/scope_exit.hpp>
#include <mcl/stdint.hpp>

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"
#include "dynarmic/interface/A64/a64.h"

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "./testenv.h"
#include "dynarmic/interface/A64/a64.h"

View file

@ -5,7 +5,7 @@
#include <array>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "../rand_int.h"
#include "../unicorn_emu/a64_unicorn.h"

View file

@ -3,7 +3,6 @@ add_executable(dynarmic_tests
fp/FPValue.cpp
fp/mantissa_util_tests.cpp
fp/unpacked_tests.cpp
main.cpp
rand_int.h
)
@ -80,7 +79,7 @@ if (("A32" IN_LIST DYNARMIC_FRONTENDS) AND ("A64" IN_LIST DYNARMIC_FRONTENDS))
create_target_directory_groups(dynarmic_print_info)
target_link_libraries(dynarmic_print_info PRIVATE dynarmic Boost::boost Catch2::Catch2 fmt::fmt merry::mcl)
target_link_libraries(dynarmic_print_info PRIVATE dynarmic Boost::boost fmt::fmt merry::mcl)
target_include_directories(dynarmic_print_info PRIVATE . ../src)
target_compile_options(dynarmic_print_info PRIVATE ${DYNARMIC_CXX_FLAGS})
target_compile_definitions(dynarmic_print_info PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)
@ -95,7 +94,7 @@ if (("A32" IN_LIST DYNARMIC_FRONTENDS) AND ("A64" IN_LIST DYNARMIC_FRONTENDS))
create_target_directory_groups(dynarmic_test_generator)
target_link_libraries(dynarmic_test_generator PRIVATE dynarmic Boost::boost Catch2::Catch2 fmt::fmt merry::mcl)
target_link_libraries(dynarmic_test_generator PRIVATE dynarmic Boost::boost fmt::fmt merry::mcl)
target_include_directories(dynarmic_test_generator PRIVATE . ../src)
target_compile_options(dynarmic_test_generator PRIVATE ${DYNARMIC_CXX_FLAGS})
target_compile_definitions(dynarmic_test_generator PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)
@ -103,7 +102,7 @@ endif()
create_target_directory_groups(dynarmic_tests)
target_link_libraries(dynarmic_tests PRIVATE dynarmic Boost::boost Catch2::Catch2 fmt::fmt merry::mcl)
target_link_libraries(dynarmic_tests PRIVATE dynarmic Boost::boost Catch2::Catch2WithMain fmt::fmt merry::mcl)
target_include_directories(dynarmic_tests PRIVATE . ../src)
target_compile_options(dynarmic_tests PRIVATE ${DYNARMIC_CXX_FLAGS})
target_compile_definitions(dynarmic_tests PRIVATE FMT_USE_USER_DEFINED_LITERALS=1 CATCH_CONFIG_ENABLE_BENCHMARKING=1)

View file

@ -7,7 +7,7 @@
#include <iomanip>
#include <iostream>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/assert.hpp>
#include "dynarmic/frontend/A32/decoder/asimd.h"

View file

@ -6,7 +6,7 @@
#include <tuple>
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/stdint.hpp>
#include "../rand_int.h"

View file

@ -6,7 +6,7 @@
#include <tuple>
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/stdint.hpp>
#include "../rand_int.h"

View file

@ -6,7 +6,7 @@
#include <tuple>
#include <vector>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <mcl/stdint.hpp>
#include "../rand_int.h"

View file

@ -1,7 +0,0 @@
/* This file is part of the dynarmic project.
* Copyright (c) 2016 MerryMage
* SPDX-License-Identifier: 0BSD
*/
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <catch2/catch.hpp>

View file

@ -3,7 +3,8 @@
* SPDX-License-Identifier: 0BSD
*/
#include <catch2/catch.hpp>
#include <catch2/benchmark/catch_benchmark.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/printf.h>
#include <mcl/stdint.hpp>

View file

@ -6,7 +6,7 @@
#include <array>
#include <utility>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <xbyak/xbyak_util.h>
TEST_CASE("Host CPU supports", "[a64]") {