##// END OF EJS Templates
Started UI unit testing...
jeandet -
r1359:609bd9b37a71
parent child
Show More
@@ -0,0 +1,1
1 declare_test(simple_graph simple_graph simple_graph/main.cpp "sciqlopgui;TestUtils;Qt5::Test")
@@ -0,0 +1,51
1 #include <QtTest>
2 #include <QObject>
3 #include <QString>
4 #include <QScreen>
5 #include <QMainWindow>
6
7
8 #include <SqpApplication.h>
9 #include <Variable/VariableController2.h>
10
11 #include <Visualization/VisualizationGraphWidget.h>
12 #include <TestProviders.h>
13
14
15 class A_SimpleGraph : public QObject {
16 Q_OBJECT
17 public:
18 A_SimpleGraph(QObject* parent=Q_NULLPTR)
19 :QObject(parent)
20 {
21
22 }
23
24 private slots:
25 void scrolls_with_mouse_wheel()
26 {
27 VisualizationGraphWidget w{Q_NULLPTR};
28 auto provider = std::make_shared<SimpleRange<10>>();
29 auto range = DateTimeRange::fromDateTime(QDate(2018,8,7),QTime(14,00),
30 QDate(2018,8,7),QTime(16,00));
31 auto var = static_cast<SqpApplication*>(qApp)->variableController().createVariable("V1", {{"","scalar"}}, provider, range);
32 w.addVariable(var, range);
33 while(!static_cast<SqpApplication*>(qApp)->variableController().isReady(var))QCoreApplication::processEvents();
34 }
35 };
36
37 QT_BEGIN_NAMESPACE
38 QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS
39 QT_END_NAMESPACE \
40 int main(int argc, char *argv[])
41 {
42 SqpApplication app{argc, argv};
43 app.setAttribute(Qt::AA_Use96Dpi, true);
44 QTEST_DISABLE_KEYPAD_NAVIGATION
45 QTEST_ADD_GPU_BLACKLIST_SUPPORT
46 A_SimpleGraph tc;
47 QTEST_SET_MAIN_SOURCE_PATH
48 return QTest::qExec(&tc, argc, argv);
49 }
50
51 #include "main.moc"
@@ -1,1 +1,1
1 Subproject commit a004497acb0e259105c92b179ab97c3fbb0379b1
1 Subproject commit e3779b99a071447cf8b6781a8ae6b414d6106b82
@@ -50,3 +50,5 install(TARGETS sciqlopgui EXPORT SciQLOPGuiConfig
50 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SciQLOP)
50 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SciQLOP)
51 install(EXPORT SciQLOPGuiConfig DESTINATION share/SciQLOPGui/cmake)
51 install(EXPORT SciQLOPGuiConfig DESTINATION share/SciQLOPGui/cmake)
52 export(TARGETS sciqlopgui FILE SciQLOPGuiConfig.cmake)
52 export(TARGETS sciqlopgui FILE SciQLOPGuiConfig.cmake)
53
54 subdirs(tests)
General Comments 0
You need to be logged in to leave comments. Login now