From 2808c9bbd0359caaf97583599def136b3f72bf8c 2019-09-24 12:11:17 From: Alexis Jeandet Date: 2019-09-24 12:11:17 Subject: [PATCH] Added missing GUI tests in meson build cfg Signed-off-by: Alexis Jeandet --- diff --git a/core b/core index 29637e9..9868166 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 29637e951955d1747d325407e2d833646c98f1c2 +Subproject commit 9868166a1d6d779910b93a996b2b69d399168914 diff --git a/gui/meson.build b/gui/meson.build index 965c4d8..f38319c 100644 --- a/gui/meson.build +++ b/gui/meson.build @@ -172,3 +172,5 @@ catalogue_browser_moc_files = qt5.preprocess(moc_sources : 'tests/catalogue/brow catalogue_browser = executable('catalogue_browser', 'tests/catalogue/browser/main.cpp',catalogue_browser_moc_files, include_directories : gui_tests_inc, dependencies :[sciqlop_gui, qt5test]) + +subdir('tests') diff --git a/gui/tests/meson.build b/gui/tests/meson.build new file mode 100644 index 0000000..40ac8ce --- /dev/null +++ b/gui/tests/meson.build @@ -0,0 +1,25 @@ + +tests_inc = include_directories(['GUITestUtils']) + +tests = [ + { + 'name':'simple_graph', + 'sources': ['simple_graph/main.cpp'], + 'deps': [sciqlop_gui, qt5test, TestUtils_dep] + }, + { + 'name':'multiple_sync_graph', + 'sources': ['multiple_sync_graph/main.cpp'], + 'deps': [sciqlop_gui, qt5test, TestUtils_dep] + } +] + +foreach unit_test : tests + test_moc_files = qt5.preprocess(moc_sources : unit_test['sources']) + test_exe = executable(unit_test['name'],unit_test['sources'] , test_moc_files, + dependencies : unit_test['deps'], + include_directories: tests_inc, + cpp_args : ['-DCORE_TESTS_RESOURCES_DIR="'+meson.current_source_dir()+'/../tests-resources"'] + ) + test('Test-' + unit_test['name'], test_exe, args: ['-teamcity', '-o', '@0@.teamcity.txt'.format(unit_test['name'])]) +endforeach diff --git a/gui/tests/multiple_sync_graph/main.cpp b/gui/tests/multiple_sync_graph/main.cpp index 1cc9ffa..a83aadf 100644 --- a/gui/tests/multiple_sync_graph/main.cpp +++ b/gui/tests/multiple_sync_graph/main.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include #include @@ -68,7 +68,7 @@ private slots: * Scroll only implies keeping the same delta T -> shift only transformation */ QVERIFY(r.m_TEnd > range.m_TEnd); - QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); + QVERIFY(cpp_utils::numeric::almost_equal(r.delta(), range.delta(), 1)); } void scrolls_right_with_mouse() @@ -89,7 +89,7 @@ private slots: * Scroll only implies keeping the same delta T -> shift only transformation */ QVERIFY(r.m_TEnd < range.m_TEnd); - QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); + QVERIFY(cpp_utils::numeric::almost_equal(r.delta(), range.delta(), 1)); } }; diff --git a/gui/tests/simple_graph/main.cpp b/gui/tests/simple_graph/main.cpp index a978b76..7e5412d 100644 --- a/gui/tests/simple_graph/main.cpp +++ b/gui/tests/simple_graph/main.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include #include @@ -56,7 +56,7 @@ private slots: * Scroll only implies keeping the same delta T -> shit only transformation */ QVERIFY(r.m_TEnd < range.m_TEnd); - QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); + QVERIFY(cpp_utils::numeric::almost_equal(r.delta(), range.delta(), 1)); } void scrolls_right_with_mouse() @@ -74,7 +74,7 @@ private slots: * Scroll only implies keeping the same delta T -> shit only transformation */ QVERIFY(r.m_TEnd > range.m_TEnd); - QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); + QVERIFY(cpp_utils::numeric::almost_equal(r.delta(), range.delta(), 1)); } };