From e220527d4e730f0bdea0a9cdfb5eb61a89a322e8 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Fri, 10 May 2019 15:40:39 +0200 Subject: ivigenerator: Add a autotest which tests the generation without any annotation This should make sure the annotations are optional and the templates provide a working default implementation. Change-Id: I1ec3b655b9d5c24e839bfea4c4bf1c674839b10d Reviewed-by: Robert Griebl --- tests/auto/core/ivigenerator/ivigenerator.pro | 1 + .../org.example.echo.noannotation.qface | 130 +++++++++++++++++++++ .../backend_simulator/backend_simulator.pro | 15 +++ .../frontend/frontend.pro | 14 +++ .../org-example-echo-noannotation.pro | 10 ++ .../org-example-echo-noannotation/test/test.pro | 14 +++ .../validator/validator.pro | 16 +++ tests/auto/core/ivigenerator/projects/projects.pro | 1 + 8 files changed, 201 insertions(+) create mode 100644 tests/auto/core/ivigenerator/org.example.echo.noannotation.qface create mode 100644 tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/backend_simulator/backend_simulator.pro create mode 100644 tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/frontend/frontend.pro create mode 100644 tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/org-example-echo-noannotation.pro create mode 100644 tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/test/test.pro create mode 100644 tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/validator/validator.pro (limited to 'tests') diff --git a/tests/auto/core/ivigenerator/ivigenerator.pro b/tests/auto/core/ivigenerator/ivigenerator.pro index 05b433a..b82cb50 100644 --- a/tests/auto/core/ivigenerator/ivigenerator.pro +++ b/tests/auto/core/ivigenerator/ivigenerator.pro @@ -4,4 +4,5 @@ SUBDIRS = projects OTHER_FILES = org.example.echo.qface \ org.example.echo.yaml \ + org.example.echo.noannotation.qface \ no-private.yaml diff --git a/tests/auto/core/ivigenerator/org.example.echo.noannotation.qface b/tests/auto/core/ivigenerator/org.example.echo.noannotation.qface new file mode 100644 index 0000000..263dc16 --- /dev/null +++ b/tests/auto/core/ivigenerator/org.example.echo.noannotation.qface @@ -0,0 +1,130 @@ +/** + * module + */ +module org.example.echo 1.0 + +/** + * \brief the brief + * the description + * continues \l http://qt.io + */ +interface Echo { + /** + * \brief brief message + * + * Some more documentation + */ + readonly string lastMessage; + int intValue; + var varValue; + real floatValue1; + real floatValue2; + string stringValue; + model contactList; + Contact contact; + Combo combo; + list intList; + list comboList; + WeekDay weekDay; + TestEnum testEnum; + real UPPERCASEPROPERTY; + + string echo(string msg); + string id() const; + Combo getCombo(); + void voidSlot(); + void voidSlot2(int param); + void timer(int interval); + signal anotherChanged(AnotherStruct another); + signal foobar(string foo); + signal somethingHappened(); + signal newValueAvailable(var newValue); +} + +interface EchoZoned { + + /** + * \brief brief message + * + * Some more documentation + */ + readonly string lastMessage; + int intValue; + var varValue; + string stringValue; + string unsupportedValue; + bool zonedValue; + bool valueWithDefault; + bool echoEnabled; + AirflowDirection airflowDirection; + int rangedValue; + int rangedValueWithDefault; + Contact contact; + Combo combo; + list intList; + list comboList; + WeekDay weekDay; + TestEnum testEnum; + real UPPERCASEPROPERTY; + + string echo(string msg); + string id(); + var varMethod(); + Combo getCombo(); + string timer(int interval); + + signal anotherChanged(AnotherStruct another); + signal foobar(string foo); + signal somethingHappened(); + signal newValueAvailable(var newValue); +} + +/** + * \brief Control where the airflow goes + */ +flag AirflowDirection { + /** + * \brief Airflow to the windshield + */ + Windshield = 1, + /** + * \brief Airflow to the dashboard + */ + Dashboard = 2, + /** + * \brief Airflow to the floor + */ + Floor = 4 +} + +flag WeekDay { + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5 +} + +enum TestEnum { + FirstEnumValue = 1, + SecondEnumValue = 2 +} + +/** + * The contact information + */ +struct Contact { + string name; + int age; + bool isMarried; + var additionalData; +} + +struct Combo { + Contact contactInfo; + WeekDay day; +} + +struct AnotherStruct { + int justANumber; +} diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/backend_simulator/backend_simulator.pro b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/backend_simulator/backend_simulator.pro new file mode 100644 index 0000000..ffefda0 --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/backend_simulator/backend_simulator.pro @@ -0,0 +1,15 @@ +TEMPLATE=lib +TARGET = $$qtLibraryTarget(echo_noannotation_simulator) +LIBS += -L$$OUT_PWD/.. -l$$qtLibraryTarget(echo_noannotation_frontend) +DESTDIR = ../qtivi + +CONFIG += warn_off ivigenerator plugin + +INCLUDEPATH += $$OUT_PWD/../frontend +PLUGIN_TYPE = qtivi +PLUGIN_CLASS_NAME = EchoPlugin + +QT += core ivicore + +QFACE_FORMAT = backend_simulator +QFACE_SOURCES = ../../../org.example.echo.noannotation.qface diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/frontend/frontend.pro b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/frontend/frontend.pro new file mode 100644 index 0000000..842b84a --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/frontend/frontend.pro @@ -0,0 +1,14 @@ +TEMPLATE=lib +TARGET= $$qtLibraryTarget(echo_noannotation_frontend) +DESTDIR = ../ + +CONFIG += ivigenerator + +QT += ivicore ivicore-private qml quick + +DEFINES += QT_BUILD_ORG_EXAMPLE_ECHO_LIB + +macos: QMAKE_SONAME_PREFIX = @rpath + +QFACE_SOURCES = ../../../org.example.echo.noannotation.qface + diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/org-example-echo-noannotation.pro b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/org-example-echo-noannotation.pro new file mode 100644 index 0000000..2446d17 --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/org-example-echo-noannotation.pro @@ -0,0 +1,10 @@ +TEMPLATE = subdirs + +SUBDIRS = frontend \ + backend_simulator \ + validator \ + test \ + +backend_simulator.depends = frontend +validator.depends = frontend +test.depends = frontend diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/test/test.pro b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/test/test.pro new file mode 100644 index 0000000..ca4a039 --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/test/test.pro @@ -0,0 +1,14 @@ +TARGET = tst_org-example-echo-noannotation +QMAKE_PROJECT_NAME = $$TARGET +DESTDIR = ../ + +QT += testlib core ivicore +CONFIG += c++11 ivigenerator testcase + +INCLUDEPATH += $$OUT_PWD/../frontend +LIBS += -L$$OUT_PWD/.. -l$$qtLibraryTarget(echo_noannotation_frontend) + +QMAKE_RPATHDIR += $$OUT_PWD/.. + +QFACE_FORMAT = test +QFACE_SOURCES = ../../../org.example.echo.noannotation.qface diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/validator/validator.pro b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/validator/validator.pro new file mode 100644 index 0000000..09ec4d1 --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo-noannotation/validator/validator.pro @@ -0,0 +1,16 @@ +TEMPLATE = app +TARGET = validator_org-example-echo-noannotation +QMAKE_PROJECT_NAME = $$TARGET +LIBS += -L$$OUT_PWD/.. -l$$qtLibraryTarget(echo_noannotation_frontend) + +DESTDIR = .. + +CONFIG += c++11 ivigenerator +CONFIG -= app_bundle + +INCLUDEPATH += $$OUT_PWD/../frontend + +QT += qml quick core ivicore + +QFACE_FORMAT = generation_validator +QFACE_SOURCES = ../../../org.example.echo.noannotation.qface diff --git a/tests/auto/core/ivigenerator/projects/projects.pro b/tests/auto/core/ivigenerator/projects/projects.pro index 66ea031..bc349a5 100644 --- a/tests/auto/core/ivigenerator/projects/projects.pro +++ b/tests/auto/core/ivigenerator/projects/projects.pro @@ -4,6 +4,7 @@ QT_FOR_CONFIG += ivicore SUBDIRS = org-example-echo \ org-example-echo-noprivate \ + org-example-echo-noannotation \ qtConfig(remoteobjects) { SUBDIRS += org-example-echo-qtro -- cgit v1.2.1