From 31a684361fb1bd1c1f03f3d833d7630b5b8d47b5 Mon Sep 17 00:00:00 2001 From: Merry Date: Sat, 31 Dec 2022 16:26:55 +0000 Subject: [PATCH] tests: Update to Catch2 v3 --- CMakeLists.txt | 2 +- tests/A32/fuzz_arm.cpp | 2 +- tests/A32/fuzz_thumb.cpp | 2 +- tests/A32/test_arm_disassembler.cpp | 2 +- tests/A32/test_arm_instructions.cpp | 2 +- tests/A32/test_coprocessor.cpp | 2 +- tests/A32/test_svc.cpp | 2 +- tests/A32/test_thumb_instructions.cpp | 2 +- tests/A64/a64.cpp | 2 +- tests/A64/fp_min_max.cpp | 2 +- tests/A64/fuzz_with_unicorn.cpp | 2 +- tests/A64/misaligned_page_table.cpp | 2 +- tests/A64/test_invalidation.cpp | 2 +- tests/A64/verify_unicorn.cpp | 2 +- tests/CMakeLists.txt | 7 +++---- tests/decoder_tests.cpp | 2 +- tests/fp/FPToFixed.cpp | 2 +- tests/fp/mantissa_util_tests.cpp | 2 +- tests/fp/unpacked_tests.cpp | 2 +- tests/main.cpp | 7 ------- tests/rsqrt_test.cpp | 3 ++- tests/x64_cpu_info.cpp | 2 +- 22 files changed, 24 insertions(+), 31 deletions(-) delete mode 100644 tests/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index cb153e29..a8f7a175 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/tests/A32/fuzz_arm.cpp b/tests/A32/fuzz_arm.cpp index 914d33cd..cda424e2 100644 --- a/tests/A32/fuzz_arm.cpp +++ b/tests/A32/fuzz_arm.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/A32/fuzz_thumb.cpp b/tests/A32/fuzz_thumb.cpp index ff68f2f2..3733dbb3 100644 --- a/tests/A32/fuzz_thumb.cpp +++ b/tests/A32/fuzz_thumb.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/tests/A32/test_arm_disassembler.cpp b/tests/A32/test_arm_disassembler.cpp index e8614d1f..5cefc0be 100644 --- a/tests/A32/test_arm_disassembler.cpp +++ b/tests/A32/test_arm_disassembler.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include "dynarmic/frontend/A32/disassembler/disassembler.h" diff --git a/tests/A32/test_arm_instructions.cpp b/tests/A32/test_arm_instructions.cpp index 1878f961..a4a07f92 100644 --- a/tests/A32/test_arm_instructions.cpp +++ b/tests/A32/test_arm_instructions.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include "./testenv.h" #include "dynarmic/frontend/A32/a32_location_descriptor.h" diff --git a/tests/A32/test_coprocessor.cpp b/tests/A32/test_coprocessor.cpp index 75017b0b..24d54efe 100644 --- a/tests/A32/test_coprocessor.cpp +++ b/tests/A32/test_coprocessor.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include "./testenv.h" #include "dynarmic/frontend/A32/a32_location_descriptor.h" diff --git a/tests/A32/test_svc.cpp b/tests/A32/test_svc.cpp index 367b89b3..bec02b76 100644 --- a/tests/A32/test_svc.cpp +++ b/tests/A32/test_svc.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include "./testenv.h" diff --git a/tests/A32/test_thumb_instructions.cpp b/tests/A32/test_thumb_instructions.cpp index 6ed59e25..dda0fc46 100644 --- a/tests/A32/test_thumb_instructions.cpp +++ b/tests/A32/test_thumb_instructions.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include #include "./testenv.h" diff --git a/tests/A64/a64.cpp b/tests/A64/a64.cpp index 395482c2..8edbf0c3 100644 --- a/tests/A64/a64.cpp +++ b/tests/A64/a64.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include "./testenv.h" #include "dynarmic/common/fp/fpsr.h" diff --git a/tests/A64/fp_min_max.cpp b/tests/A64/fp_min_max.cpp index 1644fb64..7aa1ef44 100644 --- a/tests/A64/fp_min_max.cpp +++ b/tests/A64/fp_min_max.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include #include "./testenv.h" diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index 847a2ae9..7343f87e 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/tests/A64/misaligned_page_table.cpp b/tests/A64/misaligned_page_table.cpp index 5f49d90b..f54aa586 100644 --- a/tests/A64/misaligned_page_table.cpp +++ b/tests/A64/misaligned_page_table.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include "./testenv.h" #include "dynarmic/interface/A64/a64.h" diff --git a/tests/A64/test_invalidation.cpp b/tests/A64/test_invalidation.cpp index c1ac6665..fa35b02b 100644 --- a/tests/A64/test_invalidation.cpp +++ b/tests/A64/test_invalidation.cpp @@ -3,7 +3,7 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include #include "./testenv.h" #include "dynarmic/interface/A64/a64.h" diff --git a/tests/A64/verify_unicorn.cpp b/tests/A64/verify_unicorn.cpp index d367e3cb..5ffe4f15 100644 --- a/tests/A64/verify_unicorn.cpp +++ b/tests/A64/verify_unicorn.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include "../rand_int.h" #include "../unicorn_emu/a64_unicorn.h" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ce898c87..b667aca6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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) diff --git a/tests/decoder_tests.cpp b/tests/decoder_tests.cpp index 519d2b17..2028ac98 100644 --- a/tests/decoder_tests.cpp +++ b/tests/decoder_tests.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include "dynarmic/frontend/A32/decoder/asimd.h" diff --git a/tests/fp/FPToFixed.cpp b/tests/fp/FPToFixed.cpp index 9375003f..2d1deb5e 100644 --- a/tests/fp/FPToFixed.cpp +++ b/tests/fp/FPToFixed.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include "../rand_int.h" diff --git a/tests/fp/mantissa_util_tests.cpp b/tests/fp/mantissa_util_tests.cpp index 76311f1f..cff942c7 100644 --- a/tests/fp/mantissa_util_tests.cpp +++ b/tests/fp/mantissa_util_tests.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include "../rand_int.h" diff --git a/tests/fp/unpacked_tests.cpp b/tests/fp/unpacked_tests.cpp index d61f514f..827b85ac 100644 --- a/tests/fp/unpacked_tests.cpp +++ b/tests/fp/unpacked_tests.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include "../rand_int.h" diff --git a/tests/main.cpp b/tests/main.cpp deleted file mode 100644 index 73eaf605..00000000 --- a/tests/main.cpp +++ /dev/null @@ -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 diff --git a/tests/rsqrt_test.cpp b/tests/rsqrt_test.cpp index cb49ca0c..7adbe39e 100644 --- a/tests/rsqrt_test.cpp +++ b/tests/rsqrt_test.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: 0BSD */ -#include +#include +#include #include #include diff --git a/tests/x64_cpu_info.cpp b/tests/x64_cpu_info.cpp index 70ab41c2..b17aa037 100644 --- a/tests/x64_cpu_info.cpp +++ b/tests/x64_cpu_info.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include TEST_CASE("Host CPU supports", "[a64]") {