summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_tester/config.cpp1
-rw-r--r--src/yuzu_tester/service/yuzutest.cpp7
-rw-r--r--src/yuzu_tester/yuzu.cpp54
3 files changed, 50 insertions, 12 deletions
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp
index 62407efac..d7e0d408d 100644
--- a/src/yuzu_tester/config.cpp
+++ b/src/yuzu_tester/config.cpp
@@ -93,7 +93,6 @@ void Config::ReadValues() {
93 93
94 // System 94 // System
95 Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); 95 Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false);
96 Settings::values.enable_nfc = sdl2_config->GetBoolean("System", "enable_nfc", true);
97 const auto size = sdl2_config->GetInteger("System", "users_size", 0); 96 const auto size = sdl2_config->GetInteger("System", "users_size", 0);
98 97
99 Settings::values.current_user = std::clamp<int>( 98 Settings::values.current_user = std::clamp<int>(
diff --git a/src/yuzu_tester/service/yuzutest.cpp b/src/yuzu_tester/service/yuzutest.cpp
index c25ab4aba..a5e5bddb2 100644
--- a/src/yuzu_tester/service/yuzutest.cpp
+++ b/src/yuzu_tester/service/yuzutest.cpp
@@ -57,7 +57,12 @@ private:
57 } 57 }
58 58
59 void StartIndividual(Kernel::HLERequestContext& ctx) { 59 void StartIndividual(Kernel::HLERequestContext& ctx) {
60 LOG_DEBUG(Frontend, "called"); 60 const auto name_raw = ctx.ReadBuffer();
61
62 const auto name = Common::StringFromFixedZeroTerminatedBuffer(
63 reinterpret_cast<const char*>(name_raw.data()), name_raw.size());
64
65 LOG_DEBUG(Frontend, "called, name={}", name);
61 66
62 IPC::ResponseBuilder rb{ctx, 2}; 67 IPC::ResponseBuilder rb{ctx, 2};
63 rb.Push(RESULT_SUCCESS); 68 rb.Push(RESULT_SUCCESS);
diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cpp
index 0f7067541..4b4e3d4fc 100644
--- a/src/yuzu_tester/yuzu.cpp
+++ b/src/yuzu_tester/yuzu.cpp
@@ -32,11 +32,6 @@
32#include "yuzu_tester/emu_window/emu_window_sdl2_hide.h" 32#include "yuzu_tester/emu_window/emu_window_sdl2_hide.h"
33#include "yuzu_tester/service/yuzutest.h" 33#include "yuzu_tester/service/yuzutest.h"
34 34
35#include <getopt.h>
36#ifndef _MSC_VER
37#include <unistd.h>
38#endif
39
40#ifdef _WIN32 35#ifdef _WIN32
41// windows.h needs to be included before shellapi.h 36// windows.h needs to be included before shellapi.h
42#include <windows.h> 37#include <windows.h>
@@ -44,6 +39,12 @@
44#include <shellapi.h> 39#include <shellapi.h>
45#endif 40#endif
46 41
42#undef _UNICODE
43#include <getopt.h>
44#ifndef _MSC_VER
45#include <unistd.h>
46#endif
47
47#ifdef _WIN32 48#ifdef _WIN32
48extern "C" { 49extern "C" {
49// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable 50// 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) {
170 171
171 bool finished = false; 172 bool finished = false;
172 int return_value = 0; 173 int return_value = 0;
173 const auto callback = [&finished, &return_value](std::vector<Service::Yuzu::TestResult>) { 174 const auto callback = [&finished,
175 &return_value](std::vector<Service::Yuzu::TestResult> results) {
174 finished = true; 176 finished = true;
175 return_value = code & 0xFF; 177 return_value = 0;
176 const auto text = fmt::format("Test Finished [Result Code: {:08X}]\n{}", code, string); 178
177 LOG_INFO(Frontend, text.c_str()); 179 const auto len =
178 std::cout << text << std::endl; 180 std::max<u64>(std::max_element(results.begin(), results.end(),
181 [](const auto& lhs, const auto& rhs) {
182 return lhs.name.size() < rhs.name.size();
183 })
184 ->name.size(),
185 9ull);
186
187 std::size_t passed = 0;
188 std::size_t failed = 0;
189
190 std::cout << fmt::format("Result [Res Code] | {:<{}} | Extra Data", "Test Name", len)
191 << std::endl;
192
193 for (const auto& res : results) {
194 const auto main_res = res.code == 0 ? "PASSED" : "FAILED";
195 if (res.code == 0)
196 ++passed;
197 else
198 ++failed;
199 std::cout << fmt::format("{} [{:08X}] | {:<{}} | {}", main_res, res.code, res.name, len,
200 res.data)
201 << std::endl;
202 }
203
204 std::cout << std::endl
205 << fmt::format("{:4d} Passed | {:4d} Failed | {:4d} Total | {:2.2f} Passed Ratio",
206 passed, failed, passed + failed,
207 static_cast<float>(passed) / (passed + failed))
208 << std::endl
209 << (failed == 0 ? "PASSED" : "FAILED") << std::endl;
210
211 if (failed > 0)
212 return_value = -1;
179 }; 213 };
180 214
181 Core::System& system{Core::System::GetInstance()}; 215 Core::System& system{Core::System::GetInstance()};