b15106fc09
- CMakeLists.txt - app.md - appicon.ico - main.cpp - perf_tests.cpp - perf_tests.h - qa_panel.cpp - qa_panel.h - qa_state.cpp - qa_state.h - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
107 lines
3.6 KiB
C++
107 lines
3.6 KiB
C++
// tables_qa — entrypoint thin. Orquesta tab bar + QA panel flotante.
|
|
//
|
|
// Estructura:
|
|
// main.cpp — entry + tab bar + menu (este)
|
|
// qa_state.h/.cpp — toggles + counters + helpers compartidos
|
|
// qa_panel.h/.cpp — panel flotante (Window separada)
|
|
// test_suite.h/.cpp — boton "Run Tests" del panel
|
|
// perf_tests.h/.cpp — boton "Performance Tests" (millones de filas)
|
|
// tabs.h — declaraciones de cada tab
|
|
// tab_<X>.cpp — implementacion por tab (uno por agente fn-constructor)
|
|
//
|
|
// Issue 0108. v0.1.0.
|
|
|
|
#include "app_base.h"
|
|
#include "core/icons_tabler.h"
|
|
#include "core/logger.h"
|
|
#include "core/panel_menu.h"
|
|
|
|
#include "qa_panel.h"
|
|
#include "tabs.h"
|
|
#include "qa_state.h"
|
|
#include "perf_tests.h"
|
|
|
|
#include <imgui.h>
|
|
|
|
#include <cstdio>
|
|
#include <cstring>
|
|
|
|
namespace {
|
|
|
|
bool g_show_main = true;
|
|
bool g_show_qa_panel = true;
|
|
|
|
void render() {
|
|
qa::counters().frames_rendered++;
|
|
|
|
if (g_show_qa_panel) tables_qa::render_qa_panel(&g_show_qa_panel);
|
|
|
|
if (!g_show_main) return;
|
|
|
|
if (!ImGui::Begin(TI_TABLE " tables_qa", &g_show_main,
|
|
ImGuiWindowFlags_NoCollapse)) {
|
|
ImGui::End();
|
|
return;
|
|
}
|
|
|
|
if (ImGui::BeginTabBar("##qa_tabs")) {
|
|
using namespace tables_qa::tabs;
|
|
if (ImGui::BeginTabItem(TI_TABLE " basic")) { render_basic(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem(TI_PALETTE " renderers")) { render_renderers(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("buttons")) { render_buttons(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("color_rules")) { render_color_rules(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("dots")) { render_dots(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("joins")) { render_joins(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("tql")) { render_tql(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("drill")) { render_drill(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("events")) { render_events(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem("compat")) { render_compat(); ImGui::EndTabItem(); }
|
|
if (ImGui::BeginTabItem(TI_GAUGE " perf")) {
|
|
tables_qa::render_perf_tab();
|
|
ImGui::EndTabItem();
|
|
}
|
|
ImGui::EndTabBar();
|
|
}
|
|
ImGui::End();
|
|
}
|
|
|
|
bool view_extras() {
|
|
tables_qa::render_qa_menu_item(&g_show_qa_panel);
|
|
return false;
|
|
}
|
|
|
|
} // anon
|
|
|
|
int main(int argc, char** argv) {
|
|
for (int i = 1; i < argc; ++i) {
|
|
if (std::strcmp(argv[i], "--self-test") == 0) {
|
|
std::fprintf(stdout, "tables_qa --self-test: running suite headless...\n");
|
|
// TODO fase 2: imgui_test_engine. Por ahora corre test_suite sync.
|
|
// Esto requiere init parcial de framework (logger). Skip para WIP.
|
|
std::fprintf(stdout, "tables_qa --self-test: SKIPPED (fase 2 TBD)\n");
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
static fn_ui::PanelToggle panels[] = {
|
|
{ "Main", nullptr, &g_show_main },
|
|
{ "QA Panel", nullptr, &g_show_qa_panel },
|
|
};
|
|
|
|
fn::AppConfig cfg;
|
|
cfg.title = "tables_qa";
|
|
cfg.width = 1400;
|
|
cfg.height = 900;
|
|
cfg.about = {
|
|
"tables_qa",
|
|
"0.1.0",
|
|
"Testbed agresivo del modulo data_table (issue 0108).",
|
|
};
|
|
cfg.log = { "tables_qa.log", 1 };
|
|
cfg.panels = panels;
|
|
cfg.panel_count = sizeof(panels) / sizeof(panels[0]);
|
|
cfg.view_extras = view_extras;
|
|
|
|
return fn::run_app(cfg, render);
|
|
}
|