##// END OF EJS Templates
Mini code clean on PyDataProvider...
Mini code clean on PyDataProvider Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1489:2808c9bbd035
r1491:317c38eb0f17
Show More
main.cpp
111 lines | 3.4 KiB | text/x-c | CppLexer
Switched to new TS impl but quite broken!...
r1420 #include <QMainWindow>
Added test skel for two synchronized graph widgets...
r1368 #include <QObject>
#include <QScreen>
Switched to new TS impl but quite broken!...
r1420 #include <QString>
Added test skel for two synchronized graph widgets...
r1368 #include <QWheelEvent>
Switched to new TS impl but quite broken!...
r1420 #include <QtTest>
Added test skel for two synchronized graph widgets...
r1368
#include <qcustomplot.h>
Added missing GUI tests in meson build cfg...
r1489 #include <cpp_utils.hpp>
Added test skel for two synchronized graph widgets...
r1368 #include <SqpApplication.h>
#include <Variable/VariableController2.h>
#include <GUITestUtils.h>
Switched to new TS impl but quite broken!...
r1420 #include <TestProviders.h>
#include <Visualization/VisualizationGraphWidget.h>
#include <Visualization/VisualizationZoneWidget.h>
Added test skel for two synchronized graph widgets...
r1368
Switched to new TS impl but quite broken!...
r1420 template <int GraphCount = 2>
std::tuple<std::unique_ptr<VisualizationZoneWidget>, std::vector<std::shared_ptr<Variable2>>,
std::vector<VisualizationGraphWidget*>, DateTimeRange>
Some test refac and prepared synchronized graph test...
r1369 build_multi_graph_test()
{
auto w = std::make_unique<VisualizationZoneWidget>();
Switched to new TS impl but quite broken!...
r1420 auto provider = std::make_shared<SimpleRange<10>>();
auto range = DateTimeRange::fromDateTime(
QDate(2018, 8, 7), QTime(14, 00), QDate(2018, 8, 7), QTime(16, 00));
std::vector<std::shared_ptr<Variable2>> variables;
Some test refac and prepared synchronized graph test...
r1369 std::vector<VisualizationGraphWidget*> graphs;
Switched to new TS impl but quite broken!...
r1420 for (auto i = 0; i < GraphCount; i++)
Some test refac and prepared synchronized graph test...
r1369 {
Switched to new TS impl but quite broken!...
r1420 auto var = static_cast<SqpApplication*>(qApp)->variableController().createVariable(
QString("V%1").arg(i), { { "", "scalar" } }, provider, range);
Some test refac and prepared synchronized graph test...
r1369 auto graph = new VisualizationGraphWidget();
graph->addVariable(var, range);
while (!isReady(var))
QCoreApplication::processEvents();
variables.push_back(var);
graphs.push_back(graph);
w->addGraph(graph);
}
Switched to new TS impl but quite broken!...
r1420 return { std::move(w), variables, graphs, range };
Some test refac and prepared synchronized graph test...
r1369 }
Added test skel for two synchronized graph widgets...
r1368
Switched to new TS impl but quite broken!...
r1420 class A_MultipleSyncGraphs : public QObject
{
Added test skel for two synchronized graph widgets...
r1368 Q_OBJECT
public:
Switched to new TS impl but quite broken!...
r1420 explicit A_MultipleSyncGraphs(QObject* parent = Q_NULLPTR) : QObject(parent) {}
Added test skel for two synchronized graph widgets...
r1368
private slots:
void scrolls_left_with_mouse()
{
Multi-graph test is ready, just need to implement synchronization...
r1371 auto [w, variables, graphs, range] = build_multi_graph_test<3>();
Switched to new TS impl but quite broken!...
r1420 auto var = variables.front();
Multi-graph test is ready, just need to implement synchronization...
r1371 auto graph = graphs.front();
Some test refac and prepared synchronized graph test...
r1369 QVERIFY(prepare_gui_test(w.get()));
Switched to new TS impl but quite broken!...
r1420 for (auto i = 0; i < 100; i++)
{
Multi-graph test is ready, just need to implement synchronization...
r1371 scroll_graph(graph, -200);
waitForVar(var);
}
auto r = variables.back()->range();
Added test skel for two synchronized graph widgets...
r1368
/*
News TS impl seems to pass all tests \o/...
r1421 * Scrolling to the left implies going forward in time
* Scroll only implies keeping the same delta T -> shift only transformation
Switched to new TS impl but quite broken!...
r1420 */
News TS impl seems to pass all tests \o/...
r1421 QVERIFY(r.m_TEnd > range.m_TEnd);
Added missing GUI tests in meson build cfg...
r1489 QVERIFY(cpp_utils::numeric::almost_equal<double>(r.delta(), range.delta(), 1));
Added test skel for two synchronized graph widgets...
r1368 }
void scrolls_right_with_mouse()
{
Multi-graph test is ready, just need to implement synchronization...
r1371 auto [w, variables, graphs, range] = build_multi_graph_test<3>();
Switched to new TS impl but quite broken!...
r1420 auto var = variables.front();
Multi-graph test is ready, just need to implement synchronization...
r1371 auto graph = graphs.front();
Some test refac and prepared synchronized graph test...
r1369 QVERIFY(prepare_gui_test(w.get()));
Switched to new TS impl but quite broken!...
r1420 for (auto i = 0; i < 100; i++)
{
Multi-graph test is ready, just need to implement synchronization...
r1371 scroll_graph(graph, 200);
waitForVar(var);
}
auto r = variables.back()->range();
Added test skel for two synchronized graph widgets...
r1368
/*
News TS impl seems to pass all tests \o/...
r1421 * Scrolling to the right implies going back in time
* Scroll only implies keeping the same delta T -> shift only transformation
Switched to new TS impl but quite broken!...
r1420 */
News TS impl seems to pass all tests \o/...
r1421 QVERIFY(r.m_TEnd < range.m_TEnd);
Added missing GUI tests in meson build cfg...
r1489 QVERIFY(cpp_utils::numeric::almost_equal<double>(r.delta(), range.delta(), 1));
Added test skel for two synchronized graph widgets...
r1368 }
};
Some test refac and prepared synchronized graph test...
r1369
Added test skel for two synchronized graph widgets...
r1368 QT_BEGIN_NAMESPACE
QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS
QT_END_NAMESPACE
Switched to new TS impl but quite broken!...
r1420 int main(int argc, char* argv[])
Added test skel for two synchronized graph widgets...
r1368 {
Switched to new TS impl but quite broken!...
r1420 SqpApplication app { argc, argv };
Added test skel for two synchronized graph widgets...
r1368 app.setAttribute(Qt::AA_Use96Dpi, true);
QTEST_DISABLE_KEYPAD_NAVIGATION;
QTEST_ADD_GPU_BLACKLIST_SUPPORT;
Some test refac and prepared synchronized graph test...
r1369 A_MultipleSyncGraphs tc;
Added test skel for two synchronized graph widgets...
r1368 QTEST_SET_MAIN_SOURCE_PATH;
return QTest::qExec(&tc, argc, argv);
}
#include "main.moc"