diff --git a/CMakeLists.txt b/CMakeLists.txt index 3673e50..59cd704 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,7 @@ FILE (GLOB_RECURSE core_SRCS ./include/Data/ScalarSeries.h ./include/Data/DataSeriesMergeHelper.h ./include/Data/DataSeries.h - #./include/Data/AcquisitionDataPacket.h ./include/Data/DataSeriesType.h - #./include/Data/AcquisitionRequest.h ./include/Data/SqpIterator.h ./include/Data/ArrayData.h ./include/Data/DataSeriesIterator.h diff --git a/include/Variable/VariableModel2.h b/include/Variable/VariableModel2.h index ccdaa7c..47830ef 100644 --- a/include/Variable/VariableModel2.h +++ b/include/Variable/VariableModel2.h @@ -2,6 +2,7 @@ #define SCIQLOP_VARIABLEMODEL2_H #include "CoreGlobal.h" +#include #include diff --git a/meson.build b/meson.build index 92d55b1..83f22fc 100644 --- a/meson.build +++ b/meson.build @@ -1,57 +1,103 @@ qxorm_dep = dependency('QxOrm', required : true, fallback:['QxOrm','qxorm_dep']) libcatalogs_dep = dependency('libcatalogs', required : true, fallback:['libcatalogs','libcatalogs_dep']) +pybind11_dep = dependency('pybind11', required : true, fallback:['pybind11','pybind11_dep']) core_moc_headers = [ - 'include/Catalogue/CatalogueController.h', - 'include/Common/SignalWaiter.h', - 'include/Data/IDataProvider.h', - 'include/DataSource/DataSourceController.h', - 'include/DataSource/DataSourceItemAction.h', - 'include/Network/NetworkController.h', - 'include/Time/TimeController.h', - 'include/Variable/Variable.h', - 'include/Variable/VariableCacheController.h', - 'include/Variable/VariableController.h', - 'include/Variable/VariableAcquisitionWorker.h', - 'include/Variable/VariableSynchronizationGroup.h', - 'include/Variable/VariableModel.h', - 'include/Visualization/VisualizationController.h' -] - - -core_moc_files = qt5.preprocess(moc_headers : core_moc_headers) + 'include/Network/Response.h', + 'include/Network/NetworkController.h', + 'include/Network/Downloader.h', + 'include/DataSource/DataSourceItem.h', + 'include/DataSource/DataSourceItemMergeHelper.h', + 'include/DataSource/DataSourceItemAction.h', + 'include/DataSource/DataSourceController.h', + 'include/Common/spimpl.h', + 'include/Common/StringUtils.h', + 'include/Common/SignalWaiter.h', + 'include/Common/MimeTypesDef.h', + 'include/Common/SortUtils.h', + 'include/Common/containers.h', + 'include/Common/debug.h', + 'include/Common/DateUtils.h', + 'include/Common/deprecate.h', + 'include/Common/MetaTypes.h', + 'include/Common/Numeric.h', + 'include/Time/TimeController.h', + 'include/Data/ArrayDataIterator.h', + 'include/Data/ScalarSeries.h', + 'include/Data/DataSeriesUtils.h', + 'include/Data/DataProviderParameters.h', + 'include/Data/DataSeriesMergeHelper.h', + 'include/Data/ArrayData.h', + 'include/Data/DateTimeRangeHelper.h', + 'include/Data/VectorSeries.h', + 'include/Data/DataSeries.h', + 'include/Data/SpectrogramSeries.h', + 'include/Data/SqpIterator.h', + 'include/Data/IDataProvider.h', + 'include/Data/DataSeriesIterator.h', + 'include/Data/DataSeriesType.h', + 'include/Data/Unit.h', + 'include/Data/IDataSeries.h', + 'include/Data/OptionalAxis.h', + 'include/Data/DateTimeRange.h', + 'include/Data/VariableRequest.h', + 'include/PluginManager/PluginManager.h', + 'include/Catalogue/CatalogueController.h', + 'include/Visualization/VisualizationController.h', + 'include/Settings/ISqpSettingsBindable.h', + 'include/Settings/SqpSettingsDefs.h', + 'include/Variable/ProportionalCacheStrategy.h', + 'include/Variable/VariableCacheStrategyFactory.h', + 'include/Variable/VariableSynchronizationGroup2.h', + 'include/Variable/VariableController2.h', + 'include/Variable/VariableModel2.h', + 'include/Variable/SingleThresholdCacheStrategy.h', + 'include/Variable/private/VCTransaction.h', + 'include/Variable/Variable.h', + 'include/Variable/VariableCacheStrategy.h', + 'include/CoreGlobal.h', + 'include/Plugin/IPlugin.h', + 'include/Version.h'] + + +core_moc_sources = ['src/Network/Downloader.cpp'] + + +core_moc_files = qt5.preprocess(moc_headers : core_moc_headers, moc_sources: core_moc_sources) core_sources = [ - 'src/Common/DateUtils.cpp', - 'src/Common/SignalWaiter.cpp', - 'src/Common/StringUtils.cpp', - 'src/Common/MimeTypesDef.cpp', - 'src/Catalogue/CatalogueController.cpp', - 'src/Data/ScalarSeries.cpp', - 'src/Data/SpectrogramSeries.cpp', - 'src/Data/DataSeriesIterator.cpp', - 'src/Data/ArrayDataIterator.cpp', - 'src/Data/VectorSeries.cpp', - 'src/Data/OptionalAxis.cpp', - 'src/Data/DataSeriesUtils.cpp', - 'src/DataSource/DataSourceController.cpp', - 'src/DataSource/DataSourceItem.cpp', - 'src/DataSource/DataSourceItemAction.cpp', - 'src/DataSource/DataSourceItemMergeHelper.cpp', - 'src/Network/NetworkController.cpp', - 'src/PluginManager/PluginManager.cpp', - 'src/Settings/SqpSettingsDefs.cpp', - 'src/Time/TimeController.cpp', - 'src/Variable/Variable.cpp', - 'src/Variable/VariableCacheController.cpp', - 'src/Variable/VariableController.cpp', - 'src/Variable/VariableAcquisitionWorker.cpp', - 'src/Variable/VariableSynchronizationGroup.cpp', - 'src/Variable/VariableModel.cpp', - 'src/Visualization/VisualizationController.cpp' -] + 'src/Network/NetworkController.cpp', + 'src/Network/Downloader.cpp', + 'src/DataSource/DataSourceItem.cpp', + 'src/DataSource/DataSourceController.cpp', + 'src/DataSource/DataSourceItemMergeHelper.cpp', + 'src/DataSource/DataSourceItemAction.cpp', + 'src/Common/MimeTypesDef.cpp', + 'src/Common/SignalWaiter.cpp', + 'src/Common/StringUtils.cpp', + 'src/Common/DateUtils.cpp', + 'src/Time/TimeController.cpp', + 'src/Data/DataSeriesUtils.cpp', + 'src/Data/VectorSeries.cpp', + 'src/Data/DataSeriesIterator.cpp', + 'src/Data/ScalarSeries.cpp', + 'src/Data/SpectrogramSeries.cpp', + 'src/Data/OptionalAxis.cpp', + 'src/Data/ArrayDataIterator.cpp', + #'src/pybind11_wrappers/QtWrappers.cpp', + #'src/pybind11_wrappers/CoreWrappers.cpp', + 'src/PluginManager/PluginManager.cpp', + 'src/Catalogue/CatalogueController.cpp', + 'src/Visualization/VisualizationController.cpp', + 'src/Settings/SqpSettingsDefs.cpp', + 'src/Variable/Variable.cpp', + 'src/Variable/VariableSynchronizationGroup2.cpp', + 'src/Variable/VariableController2.cpp', + 'src/Variable/VariableModel2.cpp', + 'src/Version.cpp'] + core_inc = include_directories(['include', 'include/Plugin']) @@ -60,14 +106,14 @@ sciqlop_core_lib = library('sciqlopcore', core_moc_files, cpp_args : '-DCORE_LIB', include_directories : core_inc, - dependencies : [qt5core, qt5network, libcatalogs_dep], + dependencies : [qt5core, qt5network, libcatalogs_dep, pybind11_dep], install : true ) sciqlop_core = declare_dependency(link_with : sciqlop_core_lib, include_directories : core_inc, - dependencies : [qt5core, qt5network, libcatalogs_dep]) + dependencies : [qt5core, qt5network, libcatalogs_dep, pybind11_dep]) diff --git a/tests/meson.build b/tests/meson.build index ec2a714..6678fc0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,36 +1,135 @@ +TestUtils = library('TestUtils', 'TestUtils/TestProviders.h', 'TestUtils/TestProviders.cpp', + dependencies : [sciqlop_core, qt5test] + ) -tests = [ - [['Common/TestStringUtils.cpp'],'test_string_utils','StringUtils test'], - [['Data/TestScalarSeries.cpp'],'test_scalar','ScalarSeries test'], - [['Data/TestSpectrogramSeries.cpp'],'test_spectrogram','SpectrogramSeries test'], - [['Data/TestVectorSeries.cpp'],'test_vector','VectorSeries test'], - [['Data/TestOneDimArrayData.cpp'],'test_1d','One Dim Array test'], - [['Data/TestOptionalAxis.cpp'],'test_optional_axis','OptionalAxis test'], - [['Data/TestTwoDimArrayData.cpp'],'test_2d','Two Dim Array test'], - [['Data/TestDataSeriesUtils.cpp'],'test_dataseries_util','Data series utils test'], - [['DataSource/TestDataSourceController.cpp'],'test_data_source','DataSourceController test'], - [['DataSource/TestDataSourceItem.cpp'],'test_data_source_item','DataSourceItem test'], - [['Variable/TestVariableCacheController.cpp'],'test_variable_cache','VariableCacheController test'], - [['Variable/TestVariable.cpp'],'test_variable','Variable test'], - [['Variable/TestVariableSync.cpp'],'test_variable_sync','Variable synchronization test'] -] +TestUtils_dep = declare_dependency(link_with : TestUtils, + dependencies : [sciqlop_core, qt5test]) + + +DataSeriesTestsUtils = library('DataSeriesTestsUtils', 'Data/DataSeriesBuilders.h', 'Data/DataSeriesBuilders.cpp', + 'Data/DataSeriesTestsUtils.h', + 'Data/DataSeriesTestsUtils.cpp', + dependencies : [sciqlop_core, qt5test] + ) + -amdatest_sources = [ - 'Data/DataSeriesBuilders.h', - 'Data/DataSeriesBuilders.cpp', - 'Data/DataSeriesTestsUtils.h', - 'Data/DataSeriesTestsUtils.cpp', - 'DataSource/DataSourceItemBuilder.h', - 'DataSource/DataSourceItemBuilder.cpp' +DataSeriesTestsUtils_dep = declare_dependency(link_with : DataSeriesTestsUtils, + dependencies : [sciqlop_core, qt5test]) + + + +tests = [ + { + 'name':'TestStringUtils', + 'sources': ['Common/TestStringUtils.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestContainers', + 'sources': ['Common/TestContainers.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestSyncGroup', + 'sources': ['Variable/TestSyncGroup.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestDateTimeRange', + 'sources': ['Data/TestDateTimeRange.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestDataSeriesUtils', + 'sources': ['Data/TestDataSeriesUtils.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestOptionalAxis', + 'sources': ['Data/TestOptionalAxis.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestSpectrogramSeries', + 'sources': [ + 'Data/TestSpectrogramSeries.cpp', + ], + 'deps': [sciqlop_core, qt5test, DataSeriesTestsUtils_dep] + }, + { + 'name':'TestOneDimArrayData', + 'sources': ['Data/TestOneDimArrayData.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestScalarSeries', + 'sources': [ + 'Data/TestScalarSeries.cpp', + ], + 'deps': [sciqlop_core, qt5test, DataSeriesTestsUtils_dep] + }, + { + 'name':'TestTwoDimArrayData', + 'sources': ['Data/TestTwoDimArrayData.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestVectorSeries', + 'sources': [ + 'Data/TestVectorSeries.cpp', + ], + 'deps': [sciqlop_core, qt5test, DataSeriesTestsUtils_dep] + }, + { + 'name':'TestDataSourceController', + 'sources': [ + 'DataSource/TestDataSourceController.cpp', + 'DataSource/DataSourceItemBuilder.cpp' + ], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestDataSourceItem', + 'sources': [ + 'DataSource/TestDataSourceItem.cpp', + 'DataSource/DataSourceItemBuilder.cpp' + ], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestVariable', + 'sources': ['Variable/TestVariable.cpp'], + 'deps': [sciqlop_core, qt5test] + }, + { + 'name':'TestDownloader', + 'sources': ['Network/TestDownloader.cpp'], + 'deps': [sciqlop_core, qt5test, qt5Concurrent] + }, + { + 'name':'TestVariableController2', + 'sources': ['Variable/TestVariableController2.cpp'], + 'deps': [sciqlop_core, qt5test, qt5Concurrent, TestUtils_dep] + }, + { + 'name':'TestVariableController2Async', + 'sources': ['Variable/TestVariableController2Async.cpp'], + 'deps': [sciqlop_core, qt5test, qt5Concurrent, TestUtils_dep] + }, + { + 'name':'TestVariableController2WithSync', + 'sources': ['Variable/TestVariableController2WithSync.cpp'], + 'deps': [sciqlop_core, qt5test, qt5Concurrent, TestUtils_dep] + } ] foreach unit_test : tests - test_moc_files = qt5.preprocess(moc_sources : unit_test[0]) - test_exe = executable(unit_test[1],unit_test[0] , test_moc_files, - dependencies : [sciqlop_core, qt5test], - cpp_args : ['-DCORE_TESTS_RESOURCES_DIR="'+meson.current_source_dir()+'/../tests-resources"'], - sources : [amdatest_sources]) - test(unit_test[2], test_exe, args: ['-teamcity', '-o', '@0@.teamcity.txt'.format(unit_test[1])]) + 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'], + 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