diff --git a/core b/core index a004497..e3779b9 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a004497acb0e259105c92b179ab97c3fbb0379b1 +Subproject commit e3779b99a071447cf8b6781a8ae6b414d6106b82 diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index eca2073..687536c 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -50,3 +50,5 @@ install(TARGETS sciqlopgui EXPORT SciQLOPGuiConfig install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SciQLOP) install(EXPORT SciQLOPGuiConfig DESTINATION share/SciQLOPGui/cmake) export(TARGETS sciqlopgui FILE SciQLOPGuiConfig.cmake) + +subdirs(tests) diff --git a/gui/tests/CMakeLists.txt b/gui/tests/CMakeLists.txt new file mode 100644 index 0000000..aed9389 --- /dev/null +++ b/gui/tests/CMakeLists.txt @@ -0,0 +1 @@ +declare_test(simple_graph simple_graph simple_graph/main.cpp "sciqlopgui;TestUtils;Qt5::Test") diff --git a/gui/tests/simple_graph/main.cpp b/gui/tests/simple_graph/main.cpp new file mode 100644 index 0000000..9a01f44 --- /dev/null +++ b/gui/tests/simple_graph/main.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include + + +#include +#include + +#include +#include + + +class A_SimpleGraph : public QObject { + Q_OBJECT +public: + A_SimpleGraph(QObject* parent=Q_NULLPTR) + :QObject(parent) + { + + } + +private slots: + void scrolls_with_mouse_wheel() + { + VisualizationGraphWidget w{Q_NULLPTR}; + auto provider = std::make_shared>(); + auto range = DateTimeRange::fromDateTime(QDate(2018,8,7),QTime(14,00), + QDate(2018,8,7),QTime(16,00)); + auto var = static_cast(qApp)->variableController().createVariable("V1", {{"","scalar"}}, provider, range); + w.addVariable(var, range); + while(!static_cast(qApp)->variableController().isReady(var))QCoreApplication::processEvents(); + } +}; + +QT_BEGIN_NAMESPACE +QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS +QT_END_NAMESPACE \ +int main(int argc, char *argv[]) +{ + SqpApplication app{argc, argv}; + app.setAttribute(Qt::AA_Use96Dpi, true); + QTEST_DISABLE_KEYPAD_NAVIGATION + QTEST_ADD_GPU_BLACKLIST_SUPPORT + A_SimpleGraph tc; + QTEST_SET_MAIN_SOURCE_PATH + return QTest::qExec(&tc, argc, argv); +} + +#include "main.moc"