mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	yuzu_tester: Display results in table format
This commit is contained in:
		
							parent
							
								
									f279e792b7
								
							
						
					
					
						commit
						511bf3435d
					
				| @ -93,7 +93,6 @@ void Config::ReadValues() { | |||||||
| 
 | 
 | ||||||
|     // System
 |     // System
 | ||||||
|     Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); |     Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); | ||||||
|     Settings::values.enable_nfc = sdl2_config->GetBoolean("System", "enable_nfc", true); |  | ||||||
|     const auto size = sdl2_config->GetInteger("System", "users_size", 0); |     const auto size = sdl2_config->GetInteger("System", "users_size", 0); | ||||||
| 
 | 
 | ||||||
|     Settings::values.current_user = std::clamp<int>( |     Settings::values.current_user = std::clamp<int>( | ||||||
|  | |||||||
| @ -57,7 +57,12 @@ private: | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void StartIndividual(Kernel::HLERequestContext& ctx) { |     void StartIndividual(Kernel::HLERequestContext& ctx) { | ||||||
|         LOG_DEBUG(Frontend, "called"); |         const auto name_raw = ctx.ReadBuffer(); | ||||||
|  | 
 | ||||||
|  |         const auto name = Common::StringFromFixedZeroTerminatedBuffer( | ||||||
|  |             reinterpret_cast<const char*>(name_raw.data()), name_raw.size()); | ||||||
|  | 
 | ||||||
|  |         LOG_DEBUG(Frontend, "called, name={}", name); | ||||||
| 
 | 
 | ||||||
|         IPC::ResponseBuilder rb{ctx, 2}; |         IPC::ResponseBuilder rb{ctx, 2}; | ||||||
|         rb.Push(RESULT_SUCCESS); |         rb.Push(RESULT_SUCCESS); | ||||||
|  | |||||||
| @ -32,11 +32,6 @@ | |||||||
| #include "yuzu_tester/emu_window/emu_window_sdl2_hide.h" | #include "yuzu_tester/emu_window/emu_window_sdl2_hide.h" | ||||||
| #include "yuzu_tester/service/yuzutest.h" | #include "yuzu_tester/service/yuzutest.h" | ||||||
| 
 | 
 | ||||||
| #include <getopt.h> |  | ||||||
| #ifndef _MSC_VER |  | ||||||
| #include <unistd.h> |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||||
| // windows.h needs to be included before shellapi.h
 | // windows.h needs to be included before shellapi.h
 | ||||||
| #include <windows.h> | #include <windows.h> | ||||||
| @ -44,6 +39,12 @@ | |||||||
| #include <shellapi.h> | #include <shellapi.h> | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | #undef _UNICODE | ||||||
|  | #include <getopt.h> | ||||||
|  | #ifndef _MSC_VER | ||||||
|  | #include <unistd.h> | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||||
| extern "C" { | extern "C" { | ||||||
| // tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable
 | // tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable
 | ||||||
| @ -170,12 +171,45 @@ int main(int argc, char** argv) { | |||||||
| 
 | 
 | ||||||
|     bool finished = false; |     bool finished = false; | ||||||
|     int return_value = 0; |     int return_value = 0; | ||||||
|     const auto callback = [&finished, &return_value](std::vector<Service::Yuzu::TestResult>) { |     const auto callback = [&finished, | ||||||
|  |                            &return_value](std::vector<Service::Yuzu::TestResult> results) { | ||||||
|         finished = true; |         finished = true; | ||||||
|         return_value = code & 0xFF; |         return_value = 0; | ||||||
|         const auto text = fmt::format("Test Finished [Result Code: {:08X}]\n{}", code, string); | 
 | ||||||
|         LOG_INFO(Frontend, text.c_str()); |         const auto len = | ||||||
|         std::cout << text << std::endl; |             std::max<u64>(std::max_element(results.begin(), results.end(), | ||||||
|  |                                            [](const auto& lhs, const auto& rhs) { | ||||||
|  |                                                return lhs.name.size() < rhs.name.size(); | ||||||
|  |                                            }) | ||||||
|  |                               ->name.size(), | ||||||
|  |                           9ull); | ||||||
|  | 
 | ||||||
|  |         std::size_t passed = 0; | ||||||
|  |         std::size_t failed = 0; | ||||||
|  | 
 | ||||||
|  |         std::cout << fmt::format("Result [Res Code] | {:<{}} | Extra Data", "Test Name", len) | ||||||
|  |                   << std::endl; | ||||||
|  | 
 | ||||||
|  |         for (const auto& res : results) { | ||||||
|  |             const auto main_res = res.code == 0 ? "PASSED" : "FAILED"; | ||||||
|  |             if (res.code == 0) | ||||||
|  |                 ++passed; | ||||||
|  |             else | ||||||
|  |                 ++failed; | ||||||
|  |             std::cout << fmt::format("{} [{:08X}] | {:<{}} | {}", main_res, res.code, res.name, len, | ||||||
|  |                                      res.data) | ||||||
|  |                       << std::endl; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         std::cout << std::endl | ||||||
|  |                   << fmt::format("{:4d} Passed | {:4d} Failed | {:4d} Total | {:2.2f} Passed Ratio", | ||||||
|  |                                  passed, failed, passed + failed, | ||||||
|  |                                  static_cast<float>(passed) / (passed + failed)) | ||||||
|  |                   << std::endl | ||||||
|  |                   << (failed == 0 ? "PASSED" : "FAILED") << std::endl; | ||||||
|  | 
 | ||||||
|  |         if (failed > 0) | ||||||
|  |             return_value = -1; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     Core::System& system{Core::System::GetInstance()}; |     Core::System& system{Core::System::GetInstance()}; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Zach Hilman
						Zach Hilman