qt5: QtTest support

Fixes #2933
This commit is contained in:
Christian Prochaska 2018-08-13 18:13:19 +02:00 committed by Christian Helmuth
parent 3dc822f767
commit 14a338af40
19 changed files with 307 additions and 4 deletions

View File

@ -0,0 +1,15 @@
IMPORT_QT5_INC=$(call select_from_repositories,lib/import/import-qt5.inc)
include $(IMPORT_QT5_INC)
ifeq ($(CONTRIB_DIR),)
QT5_TEST_INC_DIR := $(realpath $(call select_from_repositories,include/QtTest)/..)
else
QT5_TEST_INC_DIR := $(QT5_PORT_DIR)/include
endif
QT5_INC_DIR += $(QT5_TEST_INC_DIR)
QT5_INC_DIR += $(QT5_TEST_INC_DIR)/QtTest
QT5_INC_DIR += $(QT5_TEST_INC_DIR)/QtTest/$(QT_VERSION)
QT5_INC_DIR += $(QT5_TEST_INC_DIR)/QtTest/$(QT_VERSION)/QtTest
QT5_INC_DIR += $(QT5_TEST_INC_DIR)/QtTest/$(QT_VERSION)/QtTest/private

View File

@ -0,0 +1,11 @@
include $(call select_from_repositories,lib/import/import-qt5_test.mk)
SHARED_LIB = yes
include $(REP_DIR)/lib/mk/qt5_test_generated.inc
include $(REP_DIR)/lib/mk/qt5.inc
LIBS += qt5_core
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,58 @@
QT_DEFINES += -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DQT_NO_DATASTREAM -DQT_BUILD_TESTLIB_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB
QT_INCPATH += \
qtbase/src/testlib \
qtbase/include \
qtbase/include/QtTest \
qtbase/include/QtTest/5.8.0 \
qtbase/include/QtTest/5.8.0/QtTest \
qtbase/include/QtCore/5.8.0 \
qtbase/include/QtCore/5.8.0/QtCore \
qtbase/include/QtCore \
qtbase/mkspecs/genode-g++
QT_SOURCES += \
qtestcase.cpp \
qtestlog.cpp \
qtesttable.cpp \
qtestdata.cpp \
qtestresult.cpp \
qasciikey.cpp \
qplaintestlogger.cpp \
qxmltestlogger.cpp \
qsignaldumper.cpp \
qabstracttestlogger.cpp \
qbenchmark.cpp \
qbenchmarkmeasurement.cpp \
qbenchmarkvalgrind.cpp \
qbenchmarkevent.cpp \
qbenchmarkperfevents.cpp \
qbenchmarkmetric.cpp \
qcsvbenchmarklogger.cpp \
qteamcitylogger.cpp \
qtestelement.cpp \
qtestelementattribute.cpp \
qtestmouse.cpp \
qtestxunitstreamer.cpp \
qxunittestlogger.cpp \
qtestblacklist.cpp \
moc_qtesteventloop.cpp
QT_VPATH += \
qtbase/src/testlib \
# some source files need to be generated by moc from other source/header files before
# they get #included again by the original source file in the compiling stage
# source files generated from existing header files ('moc_%.cpp: %.h' rule in import-qt5.inc)
# extracted from 'compiler_moc_header_make_all' target
COMPILER_MOC_HEADER_MAKE_ALL_FILES = \
moc_qtesteventloop.cpp
# source files generated from existing source files ('%.moc: %.cpp' rule in import-qt5.inc)
# extracted from 'compiler_moc_source_make_all' rule
COMPILER_MOC_SOURCE_MAKE_ALL_FILES = \

View File

@ -1 +1 @@
3099fb1bfb0735393056a59c20530cf1c07bf546
b079ed010149c64065cc3e72d2821e3c1caf2b6a

View File

@ -20,7 +20,7 @@ SHA(${QTSCRIPTCLASSIC}) := 6a4c4ada6f0064f6c5d7663602a37c99250ed6c7398b1775f95de
DIR(${QTSCRIPTCLASSIC}) := src/lib/qt5/${QTSCRIPTCLASSIC}
URL(symbols) := https://github.com/cproc/genode-symbols.git
REV(symbols) := 732fb1b64a0e8e704d5a8a4fb5458be3df068751
REV(symbols) := c8b59b3e9372b6ac713b5407bfd1affb840ccb2f
DIR(symbols) := lib/symbols
@ -123,6 +123,9 @@ $(BUILD_DIR)/qtbase/src/printsupport/Makefile: $(BUILD_DIR)/qtbase/src/Makefile
$(BUILD_DIR)/qtbase/src/sql/Makefile: $(BUILD_DIR)/qtbase/src/Makefile
$(call generate_makefile, $(QT5_CONTRIB_DIR)/qtbase/src/sql/sql.pro)
$(BUILD_DIR)/qtbase/src/testlib/Makefile: $(BUILD_DIR)/qtbase/src/Makefile
$(call generate_makefile, $(QT5_CONTRIB_DIR)/qtbase/src/testlib/testlib.pro)
$(BUILD_DIR)/qtbase/src/widgets/Makefile: $(BUILD_DIR)/qtbase/src/Makefile
$(call generate_makefile, $(QT5_CONTRIB_DIR)/qtbase/src/widgets/widgets.pro)
@ -271,6 +274,12 @@ include/QtSql: $(BUILD_DIR)/qtbase/src/sql/Makefile
$(VERBOSE)cp $(QT5_CONTRIB_DIR)/qtbase/src/sql/qtsql-config.h $@/
$(VERBOSE)cp $(QT5_CONTRIB_DIR)/qtbase/src/sql/qtsql-config_p.h $@/$(VERSION)/QtSql/private/
include/QtTest: $(BUILD_DIR)/qtbase/src/testlib/Makefile
$(VERBOSE)$(MSG_GENERATE)$@
$(VERBOSE)make -f $< INSTALL_ROOT=$(CURDIR) install_class_headers $(OUTPUT_FILTER)
$(VERBOSE)make -f $< INSTALL_ROOT=$(CURDIR) install_targ_headers $(OUTPUT_FILTER)
$(VERBOSE)make -f $< INSTALL_ROOT=$(CURDIR) install_private_headers $(OUTPUT_FILTER)
include/QtWidgets: $(BUILD_DIR)/qtbase/src/widgets/Makefile
$(VERBOSE)$(MSG_GENERATE)$@
$(VERBOSE)make -f $< INSTALL_ROOT=$(CURDIR) install_class_headers $(OUTPUT_FILTER)
@ -503,6 +512,7 @@ qt5_headers: include/QtCore \
include/QtPlatformHeaders \
include/QtPrintSupport \
include/QtSql \
include/QtTest \
include/QtWidgets \
include/QtXml \
include/QtScript \

View File

@ -0,0 +1,23 @@
MIRROR_FROM_REP_DIR := lib/import/import-qt5_test.mk \
lib/import/import-qt5.inc
content: $(MIRROR_FROM_REP_DIR)
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/qt5)
MIRROR_FROM_PORT_DIR := include/QtTest \
lib/symbols/qt5_test
content: $(MIRROR_FROM_PORT_DIR)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $(dir $@)
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/lib/qt5/qt5/LICENSE.LGPLv3 $@

View File

@ -0,0 +1 @@
2018-08-13 308d9f5623aede592bc9af587a879a95b62ef933

View File

@ -0,0 +1 @@
qt5_test

View File

@ -0,0 +1,27 @@
MIRROR_FROM_REP_DIR := lib/mk/qt5_test.mk \
lib/mk/qt5_test_generated.inc \
lib/mk/qt5.inc \
content: $(MIRROR_FROM_REP_DIR) src/lib/qt5_test/target.mk
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
src/lib/qt5_test/target.mk:
mkdir -p $(dir $@)
echo "LIBS = qt5_test" > $@
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/qt5)
MIRROR_FROM_PORT_DIR := src/lib/qt5/qt5/qtbase/src/testlib
content: $(MIRROR_FROM_PORT_DIR)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $(dir $@)
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/lib/qt5/qt5/LICENSE.LGPLv3 $@

View File

@ -0,0 +1 @@
2018-08-13 8730cb4f9525a9d2959fde927065448e6b369b63

View File

@ -0,0 +1,4 @@
base
libc
qt5_core
stdcxx

View File

@ -0,0 +1,22 @@
MIRROR_FROM_REP_DIR := src/app/qt5/examples/testqstring \
src/app/qt5/tmpl/target_defaults.inc \
src/app/qt5/tmpl/target_final.inc
content: $(MIRROR_FROM_REP_DIR) LICENSE
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/qt5)
MIRROR_FROM_PORT_DIR := src/lib/qt5/qt5/qtbase/examples/qtestlib/tutorial1
content: $(MIRROR_FROM_PORT_DIR)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $(dir $@)
LICENSE:
cp $(GENODE_DIR)/LICENSE $@

View File

@ -0,0 +1 @@
2018-08-13 f94e5b93b5b3b9ae6ed99631d5378fb66b848936

View File

@ -0,0 +1,11 @@
base
libc
mesa
qt5_component
qt5_core
qt5_gui
qt5_qjpeg
qt5_qpa_nitpicker
qt5_test
qt5_widgets
stdcxx

View File

@ -0,0 +1,69 @@
source ${genode_dir}/repos/libports/run/qt5_common.inc
import_from_depot [depot_user]/src/qt5_component \
[depot_user]/src/qt5_test \
[depot_user]/src/qt5_widgets \
[depot_user]/src/qt5_testqstring
#
# Build
#
append build_components [qt5_build_components feature]
build $build_components
#
# Generate config
#
append config {
<config>
<parent-provides>}
append config [qt5_parent_provides feature]
append config {
</parent-provides>
<default caps="100"/>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append config [qt5_start_nodes feature]
append config {
<start name="testqstring" caps="200">
<resource name="RAM" quantum="80M"/>
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2018-01-01 00:01</inline>
</dir>
<tar name="qt5_dejavusans.tar"/>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
<route>
<service name="Nitpicker"> <child name="wm"/> </service>
<service name="Report" label="shape">
<child name="pointer" label="wm -> testqstring -> shape"/>
</service>
<service name="ROM" label="egl_drv.lib.so"> <parent label="egl_swrast.lib.so" /> </service>
<any-service> <parent /> <any-child/> </any-service>
</route>
</start>
</config>
}
install_config $config
#
# Boot modules
#
append boot_modules [qt5_boot_modules feature]
build_boot_image $boot_modules
run_genode_until " Finished testing of TestQString" 30

View File

@ -0,0 +1,18 @@
QT5_PORT_DIR := $(call select_from_ports,qt5)
QT5_CONTRIB_DIR := $(QT5_PORT_DIR)/src/lib/qt5/qt5
QMAKE_PROJECT_PATH = $(QT5_CONTRIB_DIR)/qtbase/examples/qtestlib/tutorial1
QMAKE_PROJECT_FILE = $(QMAKE_PROJECT_PATH)/tutorial1.pro
vpath % $(QMAKE_PROJECT_PATH)
# 'testqstring.cpp' includes 'testqstring.moc'
testqstring.o: testqstring.moc
include $(call select_from_repositories,src/app/qt5/tmpl/target_defaults.inc)
include $(call select_from_repositories,src/app/qt5/tmpl/target_final.inc)
LIBS += qt5_component
CC_CXX_WARN_STRICT =

View File

@ -45,6 +45,11 @@ LIBS += qt5_scriptclassic
endif
endif
# QtTest
ifeq ($(findstring testlib, $(QT)), testlib)
LIBS += qt5_test
endif
# QtXml
ifeq ($(findstring xml, $(QT)), xml)
LIBS += qt5_xml

View File

@ -22,6 +22,7 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
.../include/QtPrintSupport/QtPrintSupportDepends | 4 +
.../include/QtPrintSupport/qtprintsupport-config.h | 1
qtbase/include/QtSql/QtSqlDepends | 2 +
qtbase/include/QtTest/QtTestDepends | 4 +
.../5.8.0/QtWidgets/private/qtwidgets-config_p.h | 1
qtbase/include/QtWidgets/QtWidgetsDepends | 3 +
qtbase/include/QtWidgets/qtwidgets-config.h | 1
@ -45,7 +46,7 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
qtbase/src/widgets/qtwidgets-config_p.h | 1
qtbase/src/xml/qtxml-config.h | 1
qtbase/src/xml/qtxml-config_p.h | 0
41 files changed, 368 insertions(+)
42 files changed, 372 insertions(+)
create mode 100644 qtbase/include/QtCore/5.8.0/QtCore/private/qconfig_p.h
create mode 100644 qtbase/include/QtCore/5.8.0/QtCore/private/qtcore-config_p.h
create mode 100644 qtbase/include/QtCore/QtConfig
@ -64,6 +65,7 @@ From: Christian Prochaska <christian.prochaska@genode-labs.com>
create mode 100644 qtbase/include/QtPrintSupport/QtPrintSupportDepends
create mode 100644 qtbase/include/QtPrintSupport/qtprintsupport-config.h
create mode 100644 qtbase/include/QtSql/QtSqlDepends
create mode 100644 qtbase/include/QtTest/QtTestDepends
create mode 100644 qtbase/include/QtWidgets/5.8.0/QtWidgets/private/qtwidgets-config_p.h
create mode 100644 qtbase/include/QtWidgets/QtWidgetsDepends
create mode 100644 qtbase/include/QtWidgets/qtwidgets-config.h
@ -223,6 +225,16 @@ index 0000000..42eb220
@@ -0,0 +1,2 @@
+/* This file was generated by qmake with the info from <root>/src/sql/sql.pro. */
+#include <QtCore/QtCore>
diff --git a/qtbase/include/QtTest/QtTestDepends b/qtbase/include/QtTest/QtTestDepends
new file mode 100644
index 0000000..64e448e
--- /dev/null
+++ b/qtbase/include/QtTest/QtTestDepends
@@ -0,0 +1,4 @@
+/* This file was generated by qmake with the info from <root>/src/testlib/testlib.pro. */
+#ifdef __cplusplus /* create empty PCH in C mode */
+#include <QtCore/QtCore>
+#endif
diff --git a/qtbase/include/QtWidgets/5.8.0/QtWidgets/private/qtwidgets-config_p.h b/qtbase/include/QtWidgets/5.8.0/QtWidgets/private/qtwidgets-config_p.h
new file mode 100644
index 0000000..9a6332d

View File

@ -29,9 +29,10 @@ Genode-specific adaptations
.../evdevkeyboard/qevdevkeyboard_defaultmap_p.h | 4 +
.../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 17 ++++++
.../input/evdevkeyboard/qevdevkeyboardhandler_p.h | 2 +
qtbase/src/testlib/qtestcase.cpp | 2 -
qtbase/src/widgets/dialogs/qfiledialog.cpp | 2 -
qtbase/src/widgets/styles/qstylefactory.cpp | 7 +++
27 files changed, 196 insertions(+), 9 deletions(-)
28 files changed, 197 insertions(+), 10 deletions(-)
diff --git a/qtbase/src/corelib/codecs/qtextcodec.cpp b/qtbase/src/corelib/codecs/qtextcodec.cpp
index 0c9036a..0dac7c1 100644
@ -623,6 +624,19 @@ index 1ec4915..fed7024 100644
KeycodeAction processKeycode(quint16 keycode, bool pressed, bool autorepeat);
private:
diff --git a/qtbase/src/testlib/qtestcase.cpp b/qtbase/src/testlib/qtestcase.cpp
index 1c13f8e..f89b55c 100644
--- a/qtbase/src/testlib/qtestcase.cpp
+++ b/qtbase/src/testlib/qtestcase.cpp
@@ -1391,7 +1391,7 @@ FatalSignalHandler::FatalSignalHandler()
// tvOS/watchOS both define SA_ONSTACK (in sys/signal.h) but mark sigaltstack() as
// unavailable (__WATCHOS_PROHIBITED __TVOS_PROHIBITED in signal.h)
-#if defined(SA_ONSTACK) && !defined(Q_OS_TVOS) && !defined(Q_OS_WATCHOS)
+#if defined(SA_ONSTACK) && !defined(Q_OS_TVOS) && !defined(Q_OS_WATCHOS) && !defined(Q_OS_GENODE)
// Let the signal handlers use an alternate stack
// This is necessary if SIGSEGV is to catch a stack overflow
# if defined(Q_CC_GNU) && defined(Q_OF_ELF)
diff --git a/qtbase/src/widgets/dialogs/qfiledialog.cpp b/qtbase/src/widgets/dialogs/qfiledialog.cpp
index 74875fa..2f6410e 100644
--- a/qtbase/src/widgets/dialogs/qfiledialog.cpp