From c2650c6e588e6c582adb6eba9dd7251905591c37 Mon Sep 17 00:00:00 2001 From: Gliniak <153369+Gliniak@users.noreply.github.com> Date: Wed, 15 Jul 2026 23:10:37 +0200 Subject: [PATCH] [Testing] Define full test paths, unify test results of vectors to unsigned type --- src/xenia/cpu/ppc/ppc_context.cc | 4 ++-- src/xenia/cpu/ppc/testing/CMakeLists.txt | 3 +++ src/xenia/cpu/ppc/testing/ppc_testing_main.cc | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/xenia/cpu/ppc/ppc_context.cc b/src/xenia/cpu/ppc/ppc_context.cc index 5bee252f3..3a971d6e0 100644 --- a/src/xenia/cpu/ppc/ppc_context.cc +++ b/src/xenia/cpu/ppc/ppc_context.cc @@ -174,8 +174,8 @@ bool PPCContext::CompareRegWithString(const char* name, const char* value, vec128_t expected = string_util::from_string(value); if (this->v[n] != expected) { result = - fmt::format("[{:08X}, {:08X}, {:08X}, {:08X}]", this->v[n].i32[0], - this->v[n].i32[1], this->v[n].i32[2], this->v[n].i32[3]); + fmt::format("[{:08X}, {:08X}, {:08X}, {:08X}]", this->v[n].u32[0], + this->v[n].u32[1], this->v[n].u32[2], this->v[n].u32[3]); return false; } return true; diff --git a/src/xenia/cpu/ppc/testing/CMakeLists.txt b/src/xenia/cpu/ppc/testing/CMakeLists.txt index 970921eef..28d7a622e 100644 --- a/src/xenia/cpu/ppc/testing/CMakeLists.txt +++ b/src/xenia/cpu/ppc/testing/CMakeLists.txt @@ -6,6 +6,9 @@ add_executable(xenia-cpu-ppc-tests ${CMAKE_CURRENT_SOURCE_DIR}/ppc_testing_main.cc ) +target_compile_definitions(xenia-cpu-ppc-tests PRIVATE + XE_SOURCE_ROOT="${PROJECT_SOURCE_DIR}") + # Add platform-specific console app main if(WIN32) target_sources(xenia-cpu-ppc-tests PRIVATE diff --git a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc index bc589b019..c60bc872e 100644 --- a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc +++ b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc @@ -108,8 +108,10 @@ class TestSuite { name = name.replace_extension(); name_ = xe::path_to_utf8(name); - map_file_path_ = cvars::test_bin_path / name.replace_extension(".map"); - bin_file_path_ = cvars::test_bin_path / name.replace_extension(".bin"); + map_file_path_ = std::filesystem::path(XE_SOURCE_ROOT) / + cvars::test_bin_path / name.replace_extension(".map"); + bin_file_path_ = std::filesystem::path(XE_SOURCE_ROOT) / + cvars::test_bin_path / name.replace_extension(".bin"); } bool Load() { @@ -470,7 +472,8 @@ class TestRunner { bool DiscoverTests(const std::filesystem::path& test_path, std::vector& test_files) { - auto file_infos = xe::filesystem::ListFiles(test_path); + auto file_infos = xe::filesystem::ListFiles( + std::filesystem::path(XE_SOURCE_ROOT) / test_path); for (auto& file_info : file_infos) { if (file_info.name.extension() == ".s") { // Only include test files (instr_*.s), not helper files @@ -669,7 +672,7 @@ bool RunTests(const std::vector& test_names) { std::vector test_suites; bool load_failed = false; for (auto& test_path : test_files) { - TestSuite test_suite(test_path); + TestSuite test_suite(std::filesystem::path(XE_SOURCE_ROOT) / test_path); if (!test_name_filter.empty() && test_name_filter.find(test_suite.name()) == test_name_filter.end()) { continue;