aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qt5-ptest.inc
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/qt5-ptest.inc
parent3f2f3a014e19ba6c23bca85b8fd1a46a85294c58 (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>
Diffstat (limited to 'recipes-qt/qt5/qt5-ptest.inc')
-rw-r--r--recipes-qt/qt5/qt5-ptest.inc51
1 files changed, 5 insertions, 46 deletions
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
}
-