[Testing] Define full test paths, unify test results of vectors to unsigned type

This commit is contained in:
Gliniak
2026-07-15 23:10:37 +02:00
committed by Radosław Gliński
parent 7ff152a5a7
commit c2650c6e58
3 changed files with 12 additions and 6 deletions

View File

@@ -174,8 +174,8 @@ bool PPCContext::CompareRegWithString(const char* name, const char* value,
vec128_t expected = string_util::from_string<vec128_t>(value); vec128_t expected = string_util::from_string<vec128_t>(value);
if (this->v[n] != expected) { if (this->v[n] != expected) {
result = result =
fmt::format("[{:08X}, {:08X}, {:08X}, {:08X}]", this->v[n].i32[0], fmt::format("[{:08X}, {:08X}, {:08X}, {:08X}]", this->v[n].u32[0],
this->v[n].i32[1], this->v[n].i32[2], this->v[n].i32[3]); this->v[n].u32[1], this->v[n].u32[2], this->v[n].u32[3]);
return false; return false;
} }
return true; return true;

View File

@@ -6,6 +6,9 @@ add_executable(xenia-cpu-ppc-tests
${CMAKE_CURRENT_SOURCE_DIR}/ppc_testing_main.cc ${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 # Add platform-specific console app main
if(WIN32) if(WIN32)
target_sources(xenia-cpu-ppc-tests PRIVATE target_sources(xenia-cpu-ppc-tests PRIVATE

View File

@@ -108,8 +108,10 @@ class TestSuite {
name = name.replace_extension(); name = name.replace_extension();
name_ = xe::path_to_utf8(name); name_ = xe::path_to_utf8(name);
map_file_path_ = cvars::test_bin_path / name.replace_extension(".map"); map_file_path_ = std::filesystem::path(XE_SOURCE_ROOT) /
bin_file_path_ = cvars::test_bin_path / name.replace_extension(".bin"); 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() { bool Load() {
@@ -470,7 +472,8 @@ class TestRunner {
bool DiscoverTests(const std::filesystem::path& test_path, bool DiscoverTests(const std::filesystem::path& test_path,
std::vector<std::filesystem::path>& test_files) { std::vector<std::filesystem::path>& 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) { for (auto& file_info : file_infos) {
if (file_info.name.extension() == ".s") { if (file_info.name.extension() == ".s") {
// Only include test files (instr_*.s), not helper files // Only include test files (instr_*.s), not helper files
@@ -669,7 +672,7 @@ bool RunTests(const std::vector<std::string>& test_names) {
std::vector<TestSuite> test_suites; std::vector<TestSuite> test_suites;
bool load_failed = false; bool load_failed = false;
for (auto& test_path : test_files) { 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() && if (!test_name_filter.empty() &&
test_name_filter.find(test_suite.name()) == test_name_filter.end()) { test_name_filter.find(test_suite.name()) == test_name_filter.end()) {
continue; continue;