aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2018-02-01 08:39:32 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2018-05-15 14:48:53 +0000
commitfe6dbe144acbcbcbe37f5e9a07a08e414dbce036 (patch)
tree0f8c2488b8806d93dfa3e9662a9caf1e35f5e8eb
parentcfe02f26de53e5c20e6f9555059cbaaf5ab9b22f (diff)
qt5: refactor ptest
Current implementation was causing build issues as it cluttered source directories and modified recipe sysroot content. Tests are now build in the separate build directory ${B} where we don't need to worry about moving files to the recipe sysroot, and if tests are enabled in PACKAGECONFIG, they have been already built during do_compile task. Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--recipes-qt/qt5/ptest/run-ptest (renamed from recipes-qt/qt5/qtbase/run-ptest)0
-rw-r--r--recipes-qt/qt5/qt5-ptest.inc51
-rw-r--r--recipes-qt/qt5/qtbase_git.bb15
-rw-r--r--recipes-qt/qt5/qtdeclarative/run-ptest5
-rw-r--r--recipes-qt/qt5/qtquick1/run-ptest6
-rw-r--r--recipes-qt/qt5/qttools_git.bb15
-rw-r--r--recipes-qt/qt5/qtxmlpatterns/run-ptest6
7 files changed, 9 insertions, 89 deletions
diff --git a/recipes-qt/qt5/qtbase/run-ptest b/recipes-qt/qt5/ptest/run-ptest
index 044f834d..044f834d 100644
--- a/recipes-qt/qt5/qtbase/run-ptest
+++ b/recipes-qt/qt5/ptest/run-ptest
diff --git a/recipes-qt/qt5/qt5-ptest.inc b/recipes-qt/qt5/qt5-ptest.inc
index 97bce88e..56efe106 100644
--- a/recipes-qt/qt5/qt5-ptest.inc
+++ b/recipes-qt/qt5/qt5-ptest.inc
@@ -1,63 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/ptest"
SRC_URI += "file://run-ptest"
inherit ptest
-addtask do_populate_sysroot after do_install before do_compile_ptest_base
-deltask do_compile_ptest_base
-addtask do_compile_ptest_base after do_populate_sysroot before do_install_ptest_base
-deltask do_install_ptest_base
-addtask do_install_ptest_base after do_compile_ptest_base before do_package
-
do_compile_ptest() {
- cd ${S}/tests
- qmake -o Makefile tests.pro
+ mkdir -p ${B}/tests
+ cd ${B}/tests
+ ${OE_QMAKE_QMAKE} -o Makefile ${S}/tests/tests.pro
oe_runmake
}
-do_populate_sysroot_append_class-target() {
- workdir = d.getVar('WORKDIR', True)
- srcdir = workdir + '/sysroot-destdir/usr/'
- destdir = workdir + '/recipe-sysroot/usr/'
-
- def copyFiles(sourceDir, targetDir, filelist):
- for file in os.listdir(sourceDir):
- sourceFile = os.path.join(sourceDir, file)
- targetFile = os.path.join(targetDir, file)
- filelist.append(targetFile) #record the file list
- if os.path.isfile(sourceFile):
- if not os.path.exists(targetDir):
- os.makedirs(targetDir)
- if not os.path.exists(targetFile) or(os.path.exists(targetFile) and (os.path.getsize(targetFile) != os.path.getsize(sourceFile))):
- open(targetFile, "wb").write(open(sourceFile, "rb").read())
- if os.path.isdir(sourceFile):
- First_Directory = False
- copyFiles(sourceFile, targetFile, filelist)
-
- if os.path.exists(destdir):
- Tmpfilelist = []
- copyFiles(srcdir, destdir, Tmpfilelist)
-
- fp=open(workdir + '/filelist', 'w')
- for i in Tmpfilelist:
- fp.write(i)
- fp.write("\n")
- fp.close()
-}
-
fakeroot do_install_ptest() {
mkdir -p ${D}${PTEST_PATH}
t=${D}${PTEST_PATH}
- for var in ` find ${S}/tests/auto/ -name tst_*`; do
+ for var in ` find ${B}/tests/auto/ -name tst_*`; do
if [ -z ` echo ${var##*/} | grep '\.'` ]; then
echo ${var##*/} >> ${t}/tst_list
install -m 0644 ${var} ${t}
fi
done
- for file in `cat ${WORKDIR}/filelist`; do
- if [ -f $file ]; then
- rm -f $file
- fi
- done
- rm -f ${WORKDIR}/filelist
}
-
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 189e6692..e03679ed 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -1,5 +1,6 @@
require qt5.inc
require qt5-git.inc
+require qt5-ptest.inc
LICENSE = "GFDL-1.3 & BSD & ( GPL-3.0 & The-Qt-Company-GPL-Exception-1.0 | The-Qt-Company-Commercial ) & ( GPL-2.0+ | LGPL-3.0 | The-Qt-Company-Commercial )"
LIC_FILES_CHKSUM = " \
@@ -29,11 +30,8 @@ SRC_URI += "\
file://0009-Add-OE-specific-specs-for-clang-compiler.patch \
file://0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \
file://0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \
- file://run-ptest \
"
-inherit ptest
-
# LGPL-3.0 is used only in src/plugins/platforms/android/extract.cpp
# for syncqt
@@ -198,17 +196,6 @@ do_configure() {
${QT_CONFIG_FLAGS}
}
-fakeroot do_install_ptest() {
- mkdir -p ${D}${PTEST_PATH}
- t=${D}${PTEST_PATH}
- for var in ` find ${B}/tests/auto/ -name tst_*`; do
- if [ not ` echo ${var##*/} | grep '\.'` ]; then
- echo ${var##*/} >> ${t}/tst_list
- install -m 0644 ${var} ${t}
- fi
- done
-}
-
do_install_append() {
# Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory"
touch ${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/oe-device-extra.pri
diff --git a/recipes-qt/qt5/qtdeclarative/run-ptest b/recipes-qt/qt5/qtdeclarative/run-ptest
deleted file mode 100644
index 6c3f522b..00000000
--- a/recipes-qt/qt5/qtdeclarative/run-ptest
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
- ./${x};
-done
diff --git a/recipes-qt/qt5/qtquick1/run-ptest b/recipes-qt/qt5/qtquick1/run-ptest
deleted file mode 100644
index 044f834d..00000000
--- a/recipes-qt/qt5/qtquick1/run-ptest
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
- ./${x};
-done
-
diff --git a/recipes-qt/qt5/qttools_git.bb b/recipes-qt/qt5/qttools_git.bb
index 1f24d290..3ac5d486 100644
--- a/recipes-qt/qt5/qttools_git.bb
+++ b/recipes-qt/qt5/qttools_git.bb
@@ -1,5 +1,6 @@
require qt5.inc
require qt5-git.inc
+require qt5-ptest.inc
HOMEPAGE = "http://www.qt.io"
LICENSE = "GFDL-1.3 & BSD & ( GPL-3.0 & The-Qt-Company-GPL-Exception-1.0 | The-Qt-Company-Commercial ) & ( GPL-2.0+ | LGPL-3.0 | The-Qt-Company-Commercial )"
@@ -11,14 +12,11 @@ LIC_FILES_CHKSUM = " \
file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \
"
-inherit ptest
-
DEPENDS += "qtbase qtdeclarative qtxmlpatterns"
# Patches from https://github.com/meta-qt5/qttools/commits/b5.9
# 5.9.meta-qt5.5
SRC_URI += " \
- file://run-ptest \
file://0001-add-noqtwebkit-configuration.patch \
file://0002-linguist-tools-cmake-allow-overriding-the-location-f.patch \
"
@@ -35,16 +33,9 @@ SRCREV = "0c112f5980a39d370a90c34f8dfb778a6bd6a780"
BBCLASSEXTEND = "native nativesdk"
-do_compile_ptest() {
- export PATH=${STAGING_DIR_NATIVE}/usr/include/qt5:$PATH
- cd ${S}/tests
- qmake -o Makefile tests.pro
- oe_runmake
-}
-
do_install_ptest() {
mkdir -p ${D}${PTEST_PATH}
t=${D}${PTEST_PATH}
- cp ${S}/tests/auto/qtdiag/tst_tdiag $t
- cp ${S}/tests/auto/qtattributionsscanner/tst_qtattributionsscanner $t
+ cp ${B}/tests/auto/qtdiag/tst_tdiag $t
+ cp ${B}/tests/auto/qtattributionsscanner/tst_qtattributionsscanner $t
}
diff --git a/recipes-qt/qt5/qtxmlpatterns/run-ptest b/recipes-qt/qt5/qtxmlpatterns/run-ptest
deleted file mode 100644
index 044f834d..00000000
--- a/recipes-qt/qt5/qtxmlpatterns/run-ptest
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
- ./${x};
-done
-