refactor: Update proto includes and conditional compilation for gRPC

This commit is contained in:
scawful
2025-10-08 17:19:02 -04:00
parent 666b92bd07
commit 3d1d961d0a
6 changed files with 21 additions and 28 deletions

View File

@@ -22,8 +22,8 @@
#include "absl/synchronization/mutex.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "app/core/proto/imgui_test_harness.grpc.pb.h"
#include "app/core/proto/imgui_test_harness.pb.h"
#include "protos/imgui_test_harness.grpc.pb.h"
#include "protos/imgui_test_harness.pb.h"
#include "app/core/service/screenshot_utils.h"
#include "app/core/testing/test_script_parser.h"
#include "app/test/test_manager.h"

View File

@@ -5,7 +5,7 @@
#include <vector>
#include "absl/strings/string_view.h"
#include "app/core/proto/imgui_test_harness.pb.h"
#include "protos/imgui_test_harness.pb.h"
#include "app/gui/widgets/widget_id_registry.h"
#if defined(YAZE_ENABLE_IMGUI_TEST_ENGINE) && YAZE_ENABLE_IMGUI_TEST_ENGINE

View File

@@ -109,6 +109,7 @@ ImVec4 GetTestStatusColor(TestStatus status) {
return ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
}
#if defined(YAZE_WITH_GRPC)
const char* HarnessStatusToString(HarnessTestStatus status) {
switch (status) {
case HarnessTestStatus::kPassed:
@@ -145,6 +146,7 @@ HarnessTestStatus HarnessStatusFromString(absl::string_view status) {
}
return HarnessTestStatus::kUnspecified;
}
#endif // defined(YAZE_WITH_GRPC)
// TestManager implementation
TestManager& TestManager::Get() {
@@ -855,6 +857,7 @@ void TestManager::DrawTestDashboard(bool* show_dashboard) {
}
// Harness Test Results tab (for gRPC GUI automation tests)
#if defined(YAZE_WITH_GRPC)
if (ImGui::BeginTabItem("GUI Automation Tests")) {
if (ImGui::BeginChild("HarnessTests", ImVec2(0, 0), true)) {
// Display harness test summaries
@@ -1009,6 +1012,7 @@ void TestManager::DrawTestDashboard(bool* show_dashboard) {
ImGui::EndChild();
ImGui::EndTabItem();
}
#endif // defined(YAZE_WITH_GRPC)
ImGui::EndTabBar();
}

View File

@@ -384,12 +384,15 @@ class TestManager {
#endif
#endif // defined(YAZE_WITH_GRPC)
#if defined(YAZE_WITH_GRPC)
std::string GenerateHarnessTestIdLocked(absl::string_view prefix)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(harness_history_mutex_);
ABSL_EXCLUSIVE_LOCKS_REQUIRED(harness_history_mutex_);
void TrimHarnessHistoryLocked()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(harness_history_mutex_);
ABSL_EXCLUSIVE_LOCKS_REQUIRED(harness_history_mutex_);
#endif
absl::Mutex mutex_;
absl::Mutex mutex_;
};
// Utility functions for test result formatting

View File

@@ -18,7 +18,7 @@
#ifdef YAZE_WITH_GRPC
#include <grpcpp/grpcpp.h>
#include "app/core/proto/imgui_test_harness.grpc.pb.h"
#include "protos/imgui_test_harness.grpc.pb.h"
#endif
namespace yaze {