##// END OF EJS Templates
Adds variable controller and properties to test structure...
Alexandre Leroux -
r1169:49d15be9d590
parent child
Show More
@@ -0,0 +1,2
1 #include "FuzzingDefs.h"
2
@@ -0,0 +1,10
1 #ifndef SCIQLOP_FUZZINGDEFS_H
2 #define SCIQLOP_FUZZINGDEFS_H
3
4 // /////// //
5 // Aliases //
6 // /////// //
7
8 using Properties = QVariantHash;
9
10 #endif // SCIQLOP_FUZZINGDEFS_H
@@ -1,77 +1,83
1 1
2 2 amdaplugin_moc_headers = [
3 3 'include/AmdaPlugin.h',
4 4 'include/AmdaProvider.h'
5 5 ]
6 6
7 7 amdaplugin_sources = [
8 8 'src/AmdaDefs.cpp',
9 9 'src/AmdaParser.cpp',
10 10 'src/AmdaPlugin.cpp',
11 11 'src/AmdaProvider.cpp',
12 12 'src/AmdaResultParser.cpp',
13 13 'src/AmdaResultParserDefs.cpp',
14 14 'src/AmdaResultParserHelper.cpp',
15 15 'src/AmdaServer.cpp'
16 16 ]
17 17
18 18 amdaplugin_ui_files = []
19 19 amdaplugin_resources_files = [
20 20 'resources/amdaresources.qrc'
21 21 ]
22 22
23 23 amdaplugin_inc = include_directories(['include', '../../plugin/include'])
24 24
25 25 moc_gen = generator(moc,
26 26 output : 'moc_@BASENAME@.cpp',
27 27 arguments : ['@INPUT@',
28 28 '-DSCIQLOP_PLUGIN_JSON_FILE_PATH="'+meson.source_root()+'/plugins/amda/resources/amda.json"',
29 29 '-I', meson.current_source_dir()+'/include',
30 30 '-I', meson.current_source_dir()+'/../../plugin/include',
31 31 '-o', '@OUTPUT@'])
32 32
33 33 rcc_gen = generator(rcc,
34 34 output : 'qrc_@BASENAME@.cpp',
35 35 arguments : ['--name=@BASENAME@"',
36 36 '--output',
37 37 '@OUTPUT@',
38 38 '@INPUT@'])
39 39
40 40 amdaplugin_moc_plugin_files = moc_gen.process(amdaplugin_moc_headers)
41 41
42 42 amdaplugin_rcc_plugin_files = rcc_gen.process(amdaplugin_resources_files)
43 43
44 44 #amdaplugin_rcc_plugin_files = qt5.preprocess(
45 45 # qresources : amdaplugin_resources_files)
46 46
47 47 amdaplugin_moc_files = qt5.preprocess(
48 48 ui_files : amdaplugin_ui_files)
49 49
50 50 sciqlop_amdaplugin = library('amdaplugin',
51 51 amdaplugin_sources,
52 52 amdaplugin_moc_files,
53 53 amdaplugin_rcc_plugin_files,
54 54 amdaplugin_moc_plugin_files,
55 55 cpp_args : ['-DAMDA_LIB','-DQT_PLUGIN'],
56 56 include_directories : [amdaplugin_inc],
57 57 dependencies : [sciqlop_core, sciqlop_gui],
58 58 install : true
59 59 )
60 60
61 61
62 62 tests = [
63 63 [['tests/TestAmdaParser.cpp'],'test_amda_parser','AMDA parser test'],
64 64 [['tests/TestAmdaResultParser.cpp'],'test_amda_result_parser','AMDA result parser test'],
65 65 [['tests/TestAmdaAcquisition.cpp'],'test_amda_acquisition','AMDA Acquisition test'],
66 66 [['tests/TestAmdaFuzzing.cpp'],'test_amda_fuzzing','AMDA fuzzing test']
67 67 ]
68 68
69 tests_sources = [
70 'tests/FuzzingDefs.h',
71 'tests/FuzzingDefs.cpp',
72 ]
73
69 74 foreach unit_test : tests
70 75 test_moc_files = qt5.preprocess(moc_sources : unit_test[0])
71 76 test_exe = executable(unit_test[1],unit_test[0] , test_moc_files,
72 77 link_with : [sciqlop_amdaplugin],
73 78 include_directories : [amdaplugin_inc],
74 79 cpp_args : ['-DAMDA_TESTS_RESOURCES_DIR="'+meson.current_source_dir()+'/tests-resources"'],
80 sources : [tests_sources],
75 81 dependencies : [sciqlop_core, sciqlop_gui, qt5test])
76 82 test(unit_test[2], test_exe, args: ['-teamcity', '-o', '@0@.teamcity.txt'.format(unit_test[1])], timeout: 3 * 60)
77 83 endforeach
@@ -1,79 +1,91
1 1 #include <Network/NetworkController.h>
2 2 #include <SqpApplication.h>
3 3 #include <Time/TimeController.h>
4 4 #include <Variable/VariableController.h>
5 5
6 6 #include <QLoggingCategory>
7 7 #include <QObject>
8 8 #include <QtTest>
9 9
10 10 #include <memory>
11 11
12 12 Q_LOGGING_CATEGORY(LOG_TestAmdaFuzzing, "TestAmdaFuzzing")
13 13
14 14 namespace {
15 15
16 16 /**
17 17 * Class to run random tests
18 18 */
19 19 class FuzzingTest {
20 20 public:
21 explicit FuzzingTest(VariableController &variableController, Properties properties)
22 : m_VariableController{variableController},
23 m_Properties{std::move(properties)},
24 {
25 }
26
21 27 void execute()
22 28 {
23 29 /// @todo: complete
24 30 qCInfo(LOG_TestAmdaFuzzing()) << "Execution of the test completed.";
25 31 }
32
33 private:
34 VariableController &m_VariableController;
35 Properties m_Properties;
26 36 };
27 37
28 38 } // namespace
29 39
30 40 class TestAmdaFuzzing : public QObject {
31 41 Q_OBJECT
32 42
33 43 private slots:
34 44 /// Input data for @sa testFuzzing()
35 45 void testFuzzing_data();
36 46 void testFuzzing();
37 47 };
38 48
39 49 void TestAmdaFuzzing::testFuzzing_data()
40 50 {
41 51 // ////////////// //
42 52 // Test structure //
43 53 // ////////////// //
44 54
45 /// @todo: complete
55 QTest::addColumn<Properties>("properties"); // Properties for random test
46 56
47 57 // ////////// //
48 58 // Test cases //
49 59 // ////////// //
50 60
51 61 ///@todo: complete
52 62 }
53 63
54 64 void TestAmdaFuzzing::testFuzzing()
55 65 {
66 QFETCH(Properties, properties);
67
56 68 auto &variableController = sqpApp->variableController();
57 69 auto &timeController = sqpApp->timeController();
58 70
59 FuzzingTest test{};
71 FuzzingTest test{variableController, properties};
60 72 test.execute();
61 73 }
62 74
63 75 int main(int argc, char *argv[])
64 76 {
65 77 QLoggingCategory::setFilterRules(
66 78 "*.warning=false\n"
67 79 "*.info=false\n"
68 80 "*.debug=false\n"
69 81 "FuzzingOperations.info=true\n"
70 82 "TestAmdaFuzzing.info=true\n");
71 83
72 84 SqpApplication app{argc, argv};
73 85 app.setAttribute(Qt::AA_Use96Dpi, true);
74 86 TestAmdaFuzzing testObject{};
75 87 QTEST_SET_MAIN_SOURCE_PATH
76 88 return QTest::qExec(&testObject, argc, argv);
77 89 }
78 90
79 91 #include "TestAmdaFuzzing.moc"
General Comments 0
You need to be logged in to leave comments. Login now