[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);
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;

View File

@@ -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

View File

@@ -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<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) {
if (file_info.name.extension() == ".s") {
// 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;
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;