diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-03-10 07:54:41 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-03-10 13:46:15 +0100 |
commit | 69ba9acb6a2bbc4c862cd5963cba994a63f2a045 (patch) | |
tree | 65ffa9ff9aeabbd98fe35482bc0c05a27de8f55c | |
parent | 94e75b8b0ce02a24bec2b7309615f2638e37a1ce (diff) |
Fix Modbus adueditor example depending on private headers
Since our public nor private API can be modified in a way to keep
the application working, and, since we need to have such an app to
generate invalid and/or illigal frames to test the error handling
of the Modbus server, move the example into manual tests.
Fixes: QTBUG-55270
Change-Id: I1bc541f19f7327833cc74e9b80065b236969dc3c
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | examples/serialbus/modbus/CMakeLists.txt | 5 | ||||
-rw-r--r-- | examples/serialbus/modbus/adueditor/CMakeLists.txt | 51 | ||||
-rw-r--r-- | examples/serialbus/modbus/adueditor/adueditor.pro | 25 | ||||
-rw-r--r-- | examples/serialbus/modbus/modbus.pro | 1 | ||||
-rw-r--r-- | tests/manual/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/manual/modbus/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/CMakeLists.txt | 19 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/interface.ui (renamed from examples/serialbus/modbus/adueditor/interface.ui) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/main.cpp (renamed from examples/serialbus/modbus/adueditor/main.cpp) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/mainwindow.cpp (renamed from examples/serialbus/modbus/adueditor/mainwindow.cpp) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/mainwindow.h (renamed from examples/serialbus/modbus/adueditor/mainwindow.h) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/modbustcpclient.cpp (renamed from examples/serialbus/modbus/adueditor/modbustcpclient.cpp) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/modbustcpclient.h (renamed from examples/serialbus/modbus/adueditor/modbustcpclient.h) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/modbustcpclient_p.h (renamed from examples/serialbus/modbus/adueditor/modbustcpclient_p.h) | 0 | ||||
-rw-r--r-- | tests/manual/modbus/adueditor/plaintextedit.h (renamed from examples/serialbus/modbus/adueditor/plaintextedit.h) | 0 |
15 files changed, 25 insertions, 82 deletions
diff --git a/examples/serialbus/modbus/CMakeLists.txt b/examples/serialbus/modbus/CMakeLists.txt index 6de7ee7..580a311 100644 --- a/examples/serialbus/modbus/CMakeLists.txt +++ b/examples/serialbus/modbus/CMakeLists.txt @@ -1,8 +1,3 @@ add_subdirectory(client) add_subdirectory(server) add_subdirectory(custom) - -if(QT_FEATURE_modbus_serialport) - add_subdirectory(adueditor) -endif() - diff --git a/examples/serialbus/modbus/adueditor/CMakeLists.txt b/examples/serialbus/modbus/adueditor/CMakeLists.txt deleted file mode 100644 index 73919dd..0000000 --- a/examples/serialbus/modbus/adueditor/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(adueditor LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialbus/modbus/adueditor") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS SerialBus) -find_package(Qt6 COMPONENTS SerialPort) -find_package(Qt6 COMPONENTS Widgets) - -qt_add_executable(adueditor - interface.ui - main.cpp - mainwindow.cpp mainwindow.h - modbustcpclient.cpp modbustcpclient.h modbustcpclient_p.h - plaintextedit.h -) -set_target_properties(adueditor PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_include_directories(adueditor PUBLIC - . -) - -target_link_libraries(adueditor PUBLIC - Qt::Core - Qt::CorePrivate - Qt::Gui - Qt::SerialBus - Qt::SerialBusPrivate - Qt::SerialPort - Qt::Widgets -) - -install(TARGETS adueditor - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/serialbus/modbus/adueditor/adueditor.pro b/examples/serialbus/modbus/adueditor/adueditor.pro deleted file mode 100644 index 77a6158..0000000 --- a/examples/serialbus/modbus/adueditor/adueditor.pro +++ /dev/null @@ -1,25 +0,0 @@ -TEMPLATE = app -CONFIG += c++11 -INCLUDEPATH += . -TARGET = adueditor -QT += serialbus serialport widgets -QT += serialbus-private core-private -requires(qtConfig(combobox)) -requires(qtConfig(modbus-serialport)) - -SOURCES += \ - main.cpp \ - mainwindow.cpp \ - modbustcpclient.cpp - -HEADERS += \ - mainwindow.h \ - modbustcpclient.h \ - modbustcpclient_p.h \ - plaintextedit.h - -FORMS += \ - interface.ui - -target.path = $$[QT_INSTALL_EXAMPLES]/serialbus/modbus/adueditor -INSTALLS += target diff --git a/examples/serialbus/modbus/modbus.pro b/examples/serialbus/modbus/modbus.pro index bdcf5b5..28e51c1 100644 --- a/examples/serialbus/modbus/modbus.pro +++ b/examples/serialbus/modbus/modbus.pro @@ -3,5 +3,4 @@ TEMPLATE = subdirs SUBDIRS += \ client \ server \ - adueditor \ custom diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt new file mode 100644 index 0000000..1b066eb --- /dev/null +++ b/tests/manual/CMakeLists.txt @@ -0,0 +1,3 @@ +if(TARGET Qt::Widgets AND TARGET Qt::SerialBus) + add_subdirectory(modbus) +endif() diff --git a/tests/manual/modbus/CMakeLists.txt b/tests/manual/modbus/CMakeLists.txt new file mode 100644 index 0000000..50fb58f --- /dev/null +++ b/tests/manual/modbus/CMakeLists.txt @@ -0,0 +1,3 @@ +if(QT_FEATURE_modbus_serialport) + add_subdirectory(adueditor) +endif() diff --git a/tests/manual/modbus/adueditor/CMakeLists.txt b/tests/manual/modbus/adueditor/CMakeLists.txt new file mode 100644 index 0000000..bedbea2 --- /dev/null +++ b/tests/manual/modbus/adueditor/CMakeLists.txt @@ -0,0 +1,19 @@ +qt_internal_add_manual_test(adueditor + GUI + SOURCES + interface.ui + main.cpp + mainwindow.cpp mainwindow.h + modbustcpclient.cpp modbustcpclient.h modbustcpclient_p.h + plaintextedit.h + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::Gui + Qt::SerialBus + Qt::SerialBusPrivate + Qt::SerialPort + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic +) diff --git a/examples/serialbus/modbus/adueditor/interface.ui b/tests/manual/modbus/adueditor/interface.ui index 9d904b8..9d904b8 100644 --- a/examples/serialbus/modbus/adueditor/interface.ui +++ b/tests/manual/modbus/adueditor/interface.ui diff --git a/examples/serialbus/modbus/adueditor/main.cpp b/tests/manual/modbus/adueditor/main.cpp index 7655b73..7655b73 100644 --- a/examples/serialbus/modbus/adueditor/main.cpp +++ b/tests/manual/modbus/adueditor/main.cpp diff --git a/examples/serialbus/modbus/adueditor/mainwindow.cpp b/tests/manual/modbus/adueditor/mainwindow.cpp index 53d3b6e..53d3b6e 100644 --- a/examples/serialbus/modbus/adueditor/mainwindow.cpp +++ b/tests/manual/modbus/adueditor/mainwindow.cpp diff --git a/examples/serialbus/modbus/adueditor/mainwindow.h b/tests/manual/modbus/adueditor/mainwindow.h index 399ca83..399ca83 100644 --- a/examples/serialbus/modbus/adueditor/mainwindow.h +++ b/tests/manual/modbus/adueditor/mainwindow.h diff --git a/examples/serialbus/modbus/adueditor/modbustcpclient.cpp b/tests/manual/modbus/adueditor/modbustcpclient.cpp index 387c259..387c259 100644 --- a/examples/serialbus/modbus/adueditor/modbustcpclient.cpp +++ b/tests/manual/modbus/adueditor/modbustcpclient.cpp diff --git a/examples/serialbus/modbus/adueditor/modbustcpclient.h b/tests/manual/modbus/adueditor/modbustcpclient.h index 3d0ee55..3d0ee55 100644 --- a/examples/serialbus/modbus/adueditor/modbustcpclient.h +++ b/tests/manual/modbus/adueditor/modbustcpclient.h diff --git a/examples/serialbus/modbus/adueditor/modbustcpclient_p.h b/tests/manual/modbus/adueditor/modbustcpclient_p.h index a9170f9..a9170f9 100644 --- a/examples/serialbus/modbus/adueditor/modbustcpclient_p.h +++ b/tests/manual/modbus/adueditor/modbustcpclient_p.h diff --git a/examples/serialbus/modbus/adueditor/plaintextedit.h b/tests/manual/modbus/adueditor/plaintextedit.h index f5505fe..f5505fe 100644 --- a/examples/serialbus/modbus/adueditor/plaintextedit.h +++ b/tests/manual/modbus/adueditor/plaintextedit.h |