summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5
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-02-22 13:56:45 +0000
commit5250890a9f7b42a77711dfe9a3adcf86b576c2a8 (patch)
tree2f75c5d9d0a852eafe9d3b980825c41b8155e504 /recipes-qt/qt5
parent3f2f3a014e19ba6c23bca85b8fd1a46a85294c58 (diff)
downloadmeta-qt5-5250890a9f7b42a77711dfe9a3adcf86b576c2a8.tar.gz
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>
Diffstat (limited to 'recipes-qt/qt5')
-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 @@
1FILESEXTRAPATHS_append := ":${THISDIR}/ptest"
1SRC_URI += "file://run-ptest" 2SRC_URI += "file://run-ptest"
2 3
3inherit ptest 4inherit ptest
4 5
5addtask do_populate_sysroot after do_install before do_compile_ptest_base
6deltask do_compile_ptest_base
7addtask do_compile_ptest_base after do_populate_sysroot before do_install_ptest_base
8deltask do_install_ptest_base
9addtask do_install_ptest_base after do_compile_ptest_base before do_package
10
11do_compile_ptest() { 6do_compile_ptest() {
12 cd ${S}/tests 7 mkdir -p ${B}/tests
13 qmake -o Makefile tests.pro 8 cd ${B}/tests
9 ${OE_QMAKE_QMAKE} -o Makefile ${S}/tests/tests.pro
14 oe_runmake 10 oe_runmake
15} 11}
16 12
17do_populate_sysroot_append_class-target() {
18 workdir = d.getVar('WORKDIR', True)
19 srcdir = workdir + '/sysroot-destdir/usr/'
20 destdir = workdir + '/recipe-sysroot/usr/'
21
22 def copyFiles(sourceDir, targetDir, filelist):
23 for file in os.listdir(sourceDir):
24 sourceFile = os.path.join(sourceDir, file)
25 targetFile = os.path.join(targetDir, file)
26 filelist.append(targetFile) #record the file list
27 if os.path.isfile(sourceFile):
28 if not os.path.exists(targetDir):
29 os.makedirs(targetDir)
30 if not os.path.exists(targetFile) or(os.path.exists(targetFile) and (os.path.getsize(targetFile) != os.path.getsize(sourceFile))):
31 open(targetFile, "wb").write(open(sourceFile, "rb").read())
32 if os.path.isdir(sourceFile):
33 First_Directory = False
34 copyFiles(sourceFile, targetFile, filelist)
35
36 if os.path.exists(destdir):
37 Tmpfilelist = []
38 copyFiles(srcdir, destdir, Tmpfilelist)
39
40 fp=open(workdir + '/filelist', 'w')
41 for i in Tmpfilelist:
42 fp.write(i)
43 fp.write("\n")
44 fp.close()
45}
46
47fakeroot do_install_ptest() { 13fakeroot do_install_ptest() {
48 mkdir -p ${D}${PTEST_PATH} 14 mkdir -p ${D}${PTEST_PATH}
49 t=${D}${PTEST_PATH} 15 t=${D}${PTEST_PATH}
50 for var in ` find ${S}/tests/auto/ -name tst_*`; do 16 for var in ` find ${B}/tests/auto/ -name tst_*`; do
51 if [ -z ` echo ${var##*/} | grep '\.'` ]; then 17 if [ -z ` echo ${var##*/} | grep '\.'` ]; then
52 echo ${var##*/} >> ${t}/tst_list 18 echo ${var##*/} >> ${t}/tst_list
53 install -m 0644 ${var} ${t} 19 install -m 0644 ${var} ${t}
54 fi 20 fi
55 done 21 done
56 for file in `cat ${WORKDIR}/filelist`; do
57 if [ -f $file ]; then
58 rm -f $file
59 fi
60 done
61 rm -f ${WORKDIR}/filelist
62} 22}
63
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 4f3ade28..f5864096 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -1,5 +1,6 @@
1require qt5.inc 1require qt5.inc
2require qt5-git.inc 2require qt5-git.inc
3require qt5-ptest.inc
3 4
4LICENSE = "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 )" 5LICENSE = "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 )"
5LIC_FILES_CHKSUM = " \ 6LIC_FILES_CHKSUM = " \
@@ -29,11 +30,8 @@ SRC_URI += "\
29 file://0009-Add-OE-specific-specs-for-clang-compiler.patch \ 30 file://0009-Add-OE-specific-specs-for-clang-compiler.patch \
30 file://0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \ 31 file://0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \
31 file://0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \ 32 file://0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \
32 file://run-ptest \
33" 33"
34 34
35inherit ptest
36
37# LGPL-3.0 is used only in src/plugins/platforms/android/extract.cpp 35# LGPL-3.0 is used only in src/plugins/platforms/android/extract.cpp
38 36
39# for syncqt 37# for syncqt
@@ -203,17 +201,6 @@ do_configure() {
203 ${QT_CONFIG_FLAGS} 201 ${QT_CONFIG_FLAGS}
204} 202}
205 203
206fakeroot do_install_ptest() {
207 mkdir -p ${D}${PTEST_PATH}
208 t=${D}${PTEST_PATH}
209 for var in ` find ${B}/tests/auto/ -name tst_*`; do
210 if [ not ` echo ${var##*/} | grep '\.'` ]; then
211 echo ${var##*/} >> ${t}/tst_list
212 install -m 0644 ${var} ${t}
213 fi
214 done
215}
216
217do_install_append() { 204do_install_append() {
218 # Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory" 205 # Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory"
219 touch ${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/oe-device-extra.pri 206 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 @@
1#!/bin/sh
2
3for x in ` awk '{print $1}' tst_list `;do
4 ./${x};
5done
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 @@
1#!/bin/sh
2
3for x in ` awk '{print $1}' tst_list `;do
4 ./${x};
5done
6
diff --git a/recipes-qt/qt5/qttools_git.bb b/recipes-qt/qt5/qttools_git.bb
index 2187f9c3..dad5ba81 100644
--- a/recipes-qt/qt5/qttools_git.bb
+++ b/recipes-qt/qt5/qttools_git.bb
@@ -1,5 +1,6 @@
1require qt5.inc 1require qt5.inc
2require qt5-git.inc 2require qt5-git.inc
3require qt5-ptest.inc
3 4
4HOMEPAGE = "http://www.qt.io" 5HOMEPAGE = "http://www.qt.io"
5LICENSE = "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 )" 6LICENSE = "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 = " \
11 file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \ 12 file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \
12" 13"
13 14
14inherit ptest
15
16DEPENDS += "qtbase qtdeclarative qtxmlpatterns" 15DEPENDS += "qtbase qtdeclarative qtxmlpatterns"
17 16
18# Patches from https://github.com/meta-qt5/qttools/commits/b5.10 17# Patches from https://github.com/meta-qt5/qttools/commits/b5.10
19# 5.10.meta-qt5.1 18# 5.10.meta-qt5.1
20SRC_URI += " \ 19SRC_URI += " \
21 file://run-ptest \
22 file://0001-add-noqtwebkit-configuration.patch \ 20 file://0001-add-noqtwebkit-configuration.patch \
23 file://0002-linguist-tools-cmake-allow-overriding-the-location-f.patch \ 21 file://0002-linguist-tools-cmake-allow-overriding-the-location-f.patch \
24" 22"
@@ -35,16 +33,9 @@ SRCREV = "3ce89dc37d3c73033c18dcec9e4710afd747ce01"
35 33
36BBCLASSEXTEND = "native nativesdk" 34BBCLASSEXTEND = "native nativesdk"
37 35
38do_compile_ptest() {
39 export PATH=${STAGING_DIR_NATIVE}/usr/include/qt5:$PATH
40 cd ${S}/tests
41 qmake -o Makefile tests.pro
42 oe_runmake
43}
44
45do_install_ptest() { 36do_install_ptest() {
46 mkdir -p ${D}${PTEST_PATH} 37 mkdir -p ${D}${PTEST_PATH}
47 t=${D}${PTEST_PATH} 38 t=${D}${PTEST_PATH}
48 cp ${S}/tests/auto/qtdiag/tst_tdiag $t 39 cp ${B}/tests/auto/qtdiag/tst_tdiag $t
49 cp ${S}/tests/auto/qtattributionsscanner/tst_qtattributionsscanner $t 40 cp ${B}/tests/auto/qtattributionsscanner/tst_qtattributionsscanner $t
50} 41}
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 @@
1#!/bin/sh
2
3for x in ` awk '{print $1}' tst_list `;do
4 ./${x};
5done
6