Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
ExecutionTestPanel.h
Go to the documentation of this file.
1/**
2 * @file ExecutionTestPanel.h
3 * @brief Panel for executing and testing blueprint graphs with simulation.
4 * @author Olympe Engine
5 * @date 2026-03-24
6 *
7 * @details
8 * ExecutionTestPanel provides the UI for running execution simulation on
9 * blueprints, displaying trace logs, and checking for logic errors.
10 * Integrates with GraphExecutionSimulator and GraphExecutionTracer.
11 *
12 * Phase 24.3 — Blueprint validation with execution simulation.
13 * C++14 compliant.
14 */
15
16#pragma once
17
18#include <string>
19#include <vector>
20#include <memory>
21
22#include "../TaskSystem/TaskGraphTemplate.h"
25#include "BlueprintValidator.h"
26
27namespace Olympe {
28
29/**
30 * @class ExecutionTestPanel
31 * @brief ImGui panel for blueprint execution testing and validation.
32 */
34public:
35
38
39 void Initialize();
40 void Shutdown();
41
42 /**
43 * @brief Renders the test execution panel window.
44 */
45 void Render();
46
47 /**
48 * @brief Runs execution test on the specified template.
49 * @param tmpl The TaskGraphTemplate to test.
50 * @return Vector of validation errors found during test.
51 */
52 std::vector<ValidationError> RunExecutionTest(const TaskGraphTemplate& tmpl);
53
54 /**
55 * @brief Display a pre-computed trace (for BehaviorTree or native executors).
56 * @param tracer The execution trace to display
57 * @details Used by BehaviorTreeRenderer to pass trace from BehaviorTreeExecutor
58 */
60
61 /**
62 * @brief Returns true if there are test results to display.
63 */
64 bool HasResults() const { return !m_lastTestErrors.empty() || m_lastTestRun; }
65
66 /**
67 * @brief Returns the last execution trace.
68 */
70
71 /** @brief Show / hide the panel. */
72 void SetVisible(bool v) { m_visible = v; }
73 bool IsVisible() const { return m_visible; }
74
75 /**
76 * @brief Returns the execution log as a formatted string.
77 */
78 std::string GetExecutionLog() const;
79
80 /**
81 * @brief Returns a summary of the last test run.
82 */
83 std::string GetTestSummary() const;
84
85private:
86
87 void RenderTestControls();
88 void RenderTraceLog();
89 void RenderErrors();
90 void RenderSummary();
91
93
94 bool m_visible = true;
95 bool m_lastTestRun = false;
96
99 std::vector<ValidationError> m_lastTestErrors;
101
103 bool m_showTraceLog = true;
104 bool m_showErrors = true;
105 bool m_autoScroll = true;
106};
107
108} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Simulates graph execution without runtime side effects.
Graph execution tracing for simulation and validation.
ImGui panel for blueprint execution testing and validation.
const GraphExecutionTracer & GetLastTrace() const
Returns the last execution trace.
void DisplayTrace(const GraphExecutionTracer &tracer)
Display a pre-computed trace (for BehaviorTree or native executors).
bool HasResults() const
Returns true if there are test results to display.
GraphExecutionSimulator m_simulator
void RenderExecutionEventRow(const ExecutionEvent &event, size_t rowIndex)
std::string GetExecutionLog() const
Returns the execution log as a formatted string.
std::string GetTestSummary() const
Returns a summary of the last test run.
GraphExecutionTracer m_lastTracer
void SetVisible(bool v)
Show / hide the panel.
void Render()
Renders the test execution panel window.
std::vector< ValidationError > RunExecutionTest(const TaskGraphTemplate &tmpl)
Runs execution test on the specified template.
std::vector< ValidationError > m_lastTestErrors
Simulates blueprint graph execution for validation purposes.
Records execution trace during graph simulation.
Immutable, shareable task graph asset.
< Provides AssetID and INVALID_ASSET_ID
A single event recorded during graph execution trace.
Configuration options for graph simulation.