#include <test_manager.h>
Public Member Functions | |
absl::Status | RunAllTests () |
absl::Status | RunTestsByCategory (TestCategory category) |
absl::Status | RunTestSuite (const std::string &suite_name) |
void | RegisterTestSuite (std::unique_ptr< TestSuite > suite) |
std::vector< std::string > | GetTestSuiteNames () const |
TestSuite * | GetTestSuite (const std::string &name) |
const TestResults & | GetLastResults () const |
void | ClearResults () |
void | SetMaxConcurrentTests (size_t max_concurrent) |
void | SetTestTimeout (std::chrono::seconds timeout) |
void | UpdateResourceStats () |
const std::vector< ResourceStats > & | GetResourceHistory () const |
void * | GetUITestEngine () |
void | InitializeUITesting () |
void | StopUITesting () |
void | DestroyUITestingContext () |
void | ShutdownUITesting () |
bool | IsTestRunning () const |
const std::string & | GetCurrentTestName () const |
float | GetProgress () const |
void | DrawTestDashboard (bool *show_dashboard=nullptr) |
void | SetCurrentRom (Rom *rom) |
Rom * | GetCurrentRom () const |
void | RefreshCurrentRom () |
absl::Status | LoadRomForTesting (const std::string &filename) |
void | ShowRomComparisonResults (const Rom &before, const Rom &after) |
absl::Status | CreateTestRomCopy (Rom *source_rom, std::unique_ptr< Rom > &test_rom) |
std::string | GenerateTestRomFilename (const std::string &base_name) |
void | OfferTestSessionCreation (const std::string &test_rom_path) |
absl::Status | TestRomSaveLoad (Rom *rom) |
absl::Status | TestRomDataIntegrity (Rom *rom) |
absl::Status | TestRomWithCopy (Rom *source_rom, std::function< absl::Status(Rom *)> test_function) |
void | DisableTest (const std::string &test_name) |
void | EnableTest (const std::string &test_name) |
bool | IsTestEnabled (const std::string &test_name) const |
std::string | RegisterHarnessTest (const std::string &name, const std::string &category) |
void | CaptureFailureContext (const std::string &test_id) |
absl::Status | ReplayLastPlan () |
absl::Status | ShowHarnessDashboard () |
absl::Status | ShowHarnessActiveTests () |
void | RecordPlanSummary (const std::string &summary) |
Static Public Member Functions | |
static TestManager & | Get () |
Private Member Functions | |
TestManager () | |
~TestManager () | |
absl::Status | ExecuteTestSuite (TestSuite *suite) |
void | UpdateProgress () |
void | CollectResourceStats () |
void | TrimResourceHistory () |
Private Attributes | |
std::vector< std::unique_ptr< TestSuite > > | test_suites_ |
std::unordered_map< std::string, TestSuite * > | suite_lookup_ |
TestResults | last_results_ |
bool | is_running_ = false |
std::string | current_test_name_ |
float | progress_ = 0.0f |
size_t | max_concurrent_tests_ = 1 |
std::chrono::seconds | test_timeout_ {30} |
std::vector< ResourceStats > | resource_history_ |
bool | show_dashboard_ = false |
bool | show_resource_monitor_ = false |
std::string | test_filter_ |
TestCategory | category_filter_ = TestCategory::kUnit |
Rom * | current_rom_ = nullptr |
bool | show_google_tests_ = false |
bool | show_rom_test_results_ = false |
bool | show_rom_file_dialog_ = false |
bool | show_test_session_dialog_ = false |
bool | show_test_configuration_ = false |
std::string | test_rom_path_for_session_ |
std::unordered_map< std::string, bool > | disabled_tests_ |
absl::Mutex | mutex_ |
Static Private Attributes | |
static constexpr size_t | kMaxResourceHistorySize = 1000 |
Definition at line 175 of file test_manager.h.
|
private |
Definition at line 157 of file test_manager.cc.
|
private |
Definition at line 162 of file test_manager.cc.
References ShutdownUITesting().
|
static |
Definition at line 152 of file test_manager.cc.
Referenced by yaze::editor::EditorManager::BuildModernMenu(), yaze::editor::AgentChatWidget::CheckHarnessConnection(), yaze::editor::EditorManager::CloseCurrentSession(), yaze::core::CreateWindow(), yaze::test::E2ETestSuite::DrawConfiguration(), yaze::test::RomDependentTestSuite::DrawConfiguration(), yaze::test::ZSCustomOverworldTestSuite::DrawConfiguration(), yaze::editor::EditorManager::DrawMenuBar(), yaze::editor::EditorManager::Initialize(), yaze::editor::EditorManager::InitializeTestSuites(), yaze::editor::EditorManager::LoadRom(), main(), yaze::editor::EditorManager::OpenProject(), yaze::test::RegisterZ3edTestSuites(), yaze::test::ZSCustomOverworldTestSuite::RunAddressValidationTest(), yaze::test::RomDependentTestSuite::RunComprehensiveSaveTest(), yaze::test::E2ETestSuite::RunCorruptionDetectionTest(), yaze::test::E2ETestSuite::RunDataIntegrityTest(), yaze::test::ZSCustomOverworldTestSuite::RunDataIntegrityTest(), yaze::test::ZSCustomOverworldTestSuite::RunFeatureToggleTest(), yaze::test::E2ETestSuite::RunLargeScaleEditingTest(), yaze::test::IntegratedTestSuite::RunRomBasicTest(), yaze::test::E2ETestSuite::RunRomLoadSaveTest(), yaze::test::E2ETestSuite::RunTests(), yaze::test::RomDependentTestSuite::RunTests(), yaze::test::ZSCustomOverworldTestSuite::RunTests(), yaze::test::E2ETestSuite::RunTransactionSystemTest(), yaze::test::ZSCustomOverworldTestSuite::RunV2UpgradeTest(), yaze::test::ZSCustomOverworldTestSuite::RunV3UpgradeTest(), yaze::test::ZSCustomOverworldTestSuite::RunVanillaBaselineTest(), yaze::editor::EditorManager::SetCurrentRom(), yaze::core::ShutdownWindow(), yaze::editor::EditorManager::SwitchToSession(), and yaze::editor::EditorManager::Update().
absl::Status yaze::test::TestManager::RunAllTests | ( | ) |
Definition at line 212 of file test_manager.cc.
References yaze::test::TestResults::Clear(), current_test_name_, ExecuteTestSuite(), is_running_, last_results_, progress_, test_suites_, and UpdateProgress().
Referenced by yaze::editor::EditorManager::BuildModernMenu(), and DrawTestDashboard().
absl::Status yaze::test::TestManager::RunTestsByCategory | ( | TestCategory | category | ) |
Definition at line 241 of file test_manager.cc.
References yaze::test::TestResults::Clear(), current_test_name_, ExecuteTestSuite(), is_running_, last_results_, progress_, test_suites_, and UpdateProgress().
Referenced by yaze::editor::EditorManager::BuildModernMenu(), and DrawTestDashboard().
absl::Status yaze::test::TestManager::RunTestSuite | ( | const std::string & | suite_name | ) |
Definition at line 275 of file test_manager.cc.
References yaze::test::TestResults::Clear(), current_test_name_, ExecuteTestSuite(), is_running_, last_results_, progress_, and suite_lookup_.
Referenced by yaze::editor::EditorManager::BuildModernMenu().
void yaze::test::TestManager::RegisterTestSuite | ( | std::unique_ptr< TestSuite > | suite | ) |
Definition at line 299 of file test_manager.cc.
References suite_lookup_, and test_suites_.
Referenced by yaze::test::RegisterZ3edTestSuites().
std::vector< std::string > yaze::test::TestManager::GetTestSuiteNames | ( | ) | const |
Definition at line 307 of file test_manager.cc.
References test_suites_.
TestSuite * yaze::test::TestManager::GetTestSuite | ( | const std::string & | name | ) |
Definition at line 316 of file test_manager.cc.
References suite_lookup_.
|
inline |
Definition at line 190 of file test_manager.h.
References last_results_.
|
inline |
Definition at line 191 of file test_manager.h.
References yaze::test::TestResults::Clear(), and last_results_.
Referenced by yaze::editor::EditorManager::BuildModernMenu(), and DrawTestDashboard().
|
inline |
Definition at line 194 of file test_manager.h.
References max_concurrent_tests_.
|
inline |
Definition at line 197 of file test_manager.h.
References test_timeout_.
void yaze::test::TestManager::UpdateResourceStats | ( | ) |
Definition at line 321 of file test_manager.cc.
References CollectResourceStats(), and TrimResourceHistory().
|
inline |
Definition at line 201 of file test_manager.h.
References resource_history_.
|
inline |
Definition at line 214 of file test_manager.h.
|
inline |
Definition at line 215 of file test_manager.h.
Referenced by yaze::core::CreateWindow().
|
inline |
Definition at line 216 of file test_manager.h.
Referenced by yaze::core::ShutdownWindow().
|
inline |
Definition at line 217 of file test_manager.h.
Referenced by yaze::core::ShutdownWindow().
|
inline |
Definition at line 218 of file test_manager.h.
Referenced by ~TestManager().
|
inline |
Definition at line 222 of file test_manager.h.
References is_running_.
|
inline |
Definition at line 223 of file test_manager.h.
References current_test_name_.
|
inline |
Definition at line 224 of file test_manager.h.
References progress_.
void yaze::test::TestManager::DrawTestDashboard | ( | bool * | show_dashboard = nullptr | ) |
Definition at line 387 of file test_manager.cc.
References category_filter_, ClearResults(), current_rom_, current_test_name_, yaze::Rom::data(), yaze::Rom::dirty(), DisableTest(), EnableTest(), yaze::test::TestResults::failed_tests, yaze::Rom::filename(), yaze::core::FeatureFlags::get(), yaze::test::TestResults::GetPassRate(), yaze::test::GetTestStatusColor(), ICON_MD_ANALYTICS, ICON_MD_ASSESSMENT, ICON_MD_BLOCK, ICON_MD_CAMERA_ALT, ICON_MD_CHECK, ICON_MD_CHECK_CIRCLE, ICON_MD_CHECKLIST, ICON_MD_CLEAR, ICON_MD_CLOSE, ICON_MD_DESCRIPTION, ICON_MD_EDIT, ICON_MD_ERROR, ICON_MD_ERROR_OUTLINE, ICON_MD_FILTER_LIST, ICON_MD_FOLDER_OPEN, ICON_MD_HELP, ICON_MD_HISTORY, ICON_MD_INFO, ICON_MD_LAYERS, ICON_MD_MEMORY, ICON_MD_MONITOR, ICON_MD_PLAY_ARROW, ICON_MD_PLAY_CIRCLE_FILLED, ICON_MD_SCHEDULE, ICON_MD_SCIENCE, ICON_MD_SETTINGS, ICON_MD_SKIP_NEXT, ICON_MD_SPEED, ICON_MD_STORAGE, ICON_MD_TAB, ICON_MD_TEXTURE, ICON_MD_TIMER, ICON_MD_TIMER_OFF, ICON_MD_WARNING, yaze::test::TestResults::individual_results, yaze::Rom::is_loaded(), is_running_, IsTestEnabled(), yaze::test::kFailed, yaze::test::kIntegration, yaze::test::kMemory, yaze::test::kPassed, yaze::test::kPerformance, yaze::test::kRunning, yaze::test::kSkipped, yaze::test::kUI, yaze::test::kUnit, yaze::core::FeatureFlags::Flags::kUseNativeFileDialog, last_results_, LOG_INFO, yaze::test::TestResults::passed_tests, progress_, RefreshCurrentRom(), resource_history_, RunAllTests(), RunTestsByCategory(), show_dashboard_, show_google_tests_, show_resource_monitor_, show_rom_file_dialog_, show_rom_test_results_, show_test_configuration_, show_test_session_dialog_, yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowOpenFileDialogBespoke(), yaze::util::FileDialogWrapper::ShowOpenFileDialogNFD(), yaze::Rom::size(), yaze::test::TestResults::skipped_tests, test_filter_, test_rom_path_for_session_, TestRomDataIntegrity(), TestRomSaveLoad(), yaze::Rom::title(), yaze::test::TestResults::total_duration, and yaze::test::TestResults::total_tests.
|
inline |
Definition at line 230 of file test_manager.h.
References current_rom_, yaze::Rom::is_loaded(), LOG_INFO, and yaze::Rom::title().
Referenced by yaze::editor::EditorManager::CloseCurrentSession(), yaze::editor::EditorManager::LoadRom(), yaze::editor::EditorManager::OpenProject(), yaze::editor::EditorManager::SetCurrentRom(), yaze::editor::EditorManager::SwitchToSession(), and yaze::editor::EditorManager::Update().
|
inline |
Definition at line 238 of file test_manager.h.
References current_rom_.
Referenced by yaze::test::E2ETestSuite::DrawConfiguration(), yaze::test::RomDependentTestSuite::DrawConfiguration(), yaze::test::ZSCustomOverworldTestSuite::DrawConfiguration(), yaze::test::IntegratedTestSuite::RunRomBasicTest(), yaze::test::E2ETestSuite::RunTests(), yaze::test::RomDependentTestSuite::RunTests(), and yaze::test::ZSCustomOverworldTestSuite::RunTests().
void yaze::test::TestManager::RefreshCurrentRom | ( | ) |
Definition at line 1469 of file test_manager.cc.
References current_rom_, yaze::Rom::dirty(), yaze::Rom::is_loaded(), LOG_INFO, yaze::Rom::size(), and yaze::Rom::title().
Referenced by DrawTestDashboard().
absl::Status yaze::test::TestManager::LoadRomForTesting | ( | const std::string & | filename | ) |
Definition at line 1572 of file test_manager.cc.
References LOG_INFO.
Definition at line 1581 of file test_manager.cc.
References yaze::Rom::dirty(), ICON_MD_COMPARE, and yaze::Rom::size().
absl::Status yaze::test::TestManager::CreateTestRomCopy | ( | Rom * | source_rom, |
std::unique_ptr< Rom > & | test_rom | ||
) |
Definition at line 1494 of file test_manager.cc.
References yaze::Rom::is_loaded(), LOG_INFO, yaze::Rom::title(), and yaze::Rom::vector().
Referenced by TestRomWithCopy().
std::string yaze::test::TestManager::GenerateTestRomFilename | ( | const std::string & | base_name | ) |
Definition at line 1518 of file test_manager.cc.
Referenced by TestRomSaveLoad().
void yaze::test::TestManager::OfferTestSessionCreation | ( | const std::string & | test_rom_path | ) |
Definition at line 1545 of file test_manager.cc.
References show_test_session_dialog_, and test_rom_path_for_session_.
Referenced by TestRomSaveLoad().
absl::Status yaze::test::TestManager::TestRomSaveLoad | ( | Rom * | rom | ) |
Definition at line 1615 of file test_manager.cc.
References yaze::Rom::SaveSettings::backup, yaze::Rom::SaveSettings::filename, GenerateTestRomFilename(), yaze::Rom::is_loaded(), LOG_INFO, OfferTestSessionCreation(), yaze::Rom::SaveSettings::save_new, yaze::Rom::SaveToFile(), TestRomWithCopy(), and yaze::Rom::title().
Referenced by DrawTestDashboard().
absl::Status yaze::test::TestManager::TestRomDataIntegrity | ( | Rom * | rom | ) |
Definition at line 1647 of file test_manager.cc.
References yaze::Rom::is_loaded(), LOG_INFO, yaze::Rom::ReadByteVector(), yaze::Rom::size(), TestRomWithCopy(), and yaze::Rom::title().
Referenced by DrawTestDashboard().
absl::Status yaze::test::TestManager::TestRomWithCopy | ( | Rom * | source_rom, |
std::function< absl::Status(Rom *)> | test_function | ||
) |
Definition at line 1551 of file test_manager.cc.
References CreateTestRomCopy(), yaze::Rom::is_loaded(), LOG_INFO, and RETURN_IF_ERROR.
Referenced by TestRomDataIntegrity(), and TestRomSaveLoad().
|
inline |
Definition at line 260 of file test_manager.h.
References disabled_tests_.
Referenced by DrawTestDashboard().
|
inline |
Definition at line 263 of file test_manager.h.
References disabled_tests_.
Referenced by DrawTestDashboard().
|
inline |
Definition at line 266 of file test_manager.h.
References disabled_tests_.
Referenced by DrawTestDashboard().
std::string yaze::test::TestManager::RegisterHarnessTest | ( | const std::string & | name, |
const std::string & | category | ||
) |
Definition at line 1698 of file test_manager.cc.
void yaze::test::TestManager::CaptureFailureContext | ( | const std::string & | test_id | ) |
Definition at line 1860 of file test_manager.cc.
absl::Status yaze::test::TestManager::ReplayLastPlan | ( | ) |
Definition at line 1883 of file test_manager.cc.
Referenced by yaze::editor::EditorManager::Initialize().
absl::Status yaze::test::TestManager::ShowHarnessDashboard | ( | ) |
Definition at line 1888 of file test_manager.cc.
Referenced by yaze::editor::EditorManager::Initialize().
absl::Status yaze::test::TestManager::ShowHarnessActiveTests | ( | ) |
Definition at line 1897 of file test_manager.cc.
Referenced by yaze::editor::EditorManager::Initialize().
void yaze::test::TestManager::RecordPlanSummary | ( | const std::string & | summary | ) |
Definition at line 1905 of file test_manager.cc.
|
private |
Definition at line 326 of file test_manager.cc.
References CollectResourceStats(), last_results_, and yaze::test::TestSuite::RunTests().
Referenced by RunAllTests(), RunTestsByCategory(), and RunTestSuite().
|
private |
Definition at line 343 of file test_manager.cc.
References progress_, and test_suites_.
Referenced by RunAllTests(), and RunTestsByCategory().
|
private |
Definition at line 359 of file test_manager.cc.
References yaze::test::ResourceStats::frame_rate, yaze::gfx::Arena::Get(), yaze::test::ResourceStats::memory_usage_mb, resource_history_, yaze::test::ResourceStats::surface_count, yaze::test::ResourceStats::texture_count, and yaze::test::ResourceStats::timestamp.
Referenced by ExecuteTestSuite(), and UpdateResourceStats().
|
private |
Definition at line 378 of file test_manager.cc.
References kMaxResourceHistorySize, and resource_history_.
Referenced by UpdateResourceStats().
|
private |
Definition at line 329 of file test_manager.h.
Referenced by GetTestSuiteNames(), RegisterTestSuite(), RunAllTests(), RunTestsByCategory(), and UpdateProgress().
|
private |
Definition at line 330 of file test_manager.h.
Referenced by GetTestSuite(), RegisterTestSuite(), and RunTestSuite().
|
private |
Definition at line 332 of file test_manager.h.
Referenced by ClearResults(), DrawTestDashboard(), ExecuteTestSuite(), GetLastResults(), RunAllTests(), RunTestsByCategory(), and RunTestSuite().
|
private |
Definition at line 333 of file test_manager.h.
Referenced by DrawTestDashboard(), IsTestRunning(), RunAllTests(), RunTestsByCategory(), and RunTestSuite().
|
private |
Definition at line 334 of file test_manager.h.
Referenced by DrawTestDashboard(), GetCurrentTestName(), RunAllTests(), RunTestsByCategory(), and RunTestSuite().
|
private |
Definition at line 335 of file test_manager.h.
Referenced by DrawTestDashboard(), GetProgress(), RunAllTests(), RunTestsByCategory(), RunTestSuite(), and UpdateProgress().
|
private |
Definition at line 338 of file test_manager.h.
Referenced by SetMaxConcurrentTests().
|
private |
Definition at line 339 of file test_manager.h.
Referenced by SetTestTimeout().
|
private |
Definition at line 342 of file test_manager.h.
Referenced by CollectResourceStats(), DrawTestDashboard(), GetResourceHistory(), and TrimResourceHistory().
|
staticconstexprprivate |
Definition at line 343 of file test_manager.h.
Referenced by TrimResourceHistory().
|
private |
Definition at line 351 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 352 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 353 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 354 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 357 of file test_manager.h.
Referenced by DrawTestDashboard(), GetCurrentRom(), RefreshCurrentRom(), and SetCurrentRom().
|
private |
Definition at line 361 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 362 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 363 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 364 of file test_manager.h.
Referenced by DrawTestDashboard(), and OfferTestSessionCreation().
|
private |
Definition at line 365 of file test_manager.h.
Referenced by DrawTestDashboard().
|
private |
Definition at line 366 of file test_manager.h.
Referenced by DrawTestDashboard(), and OfferTestSessionCreation().
|
private |
Definition at line 369 of file test_manager.h.
Referenced by DisableTest(), EnableTest(), and IsTestEnabled().
|
private |
Definition at line 402 of file test_manager.h.