diff options
| author | Huang Qiyu <huangqy.fnst@cn.fujitsu.com> | 2017-07-12 12:58:38 +0800 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-07-12 10:24:56 +0200 |
| commit | 05455e605ba75ad12fc6a29630e53ccfa74609e4 (patch) | |
| tree | 4c0afc12528bbcecc54982c3b65053f8c672b034 | |
| parent | 428be3cc164e9b5ce2188b4815567c768f6ea79a (diff) | |
| download | meta-qt5-05455e605ba75ad12fc6a29630e53ccfa74609e4.tar.gz | |
qt5: add qt5-ptest.inc
Add qt5-ptest.inc file for qt ptest related tasks
1) Rewrite do_compile_ptest task for qt
2) Add new do_compile_ptest_base and task do_install_ptest
3) Write do_populate_sysroot_append to resolve do_compile_ptest_base problem in yocto2.3
The compile error log is shown as follow:
cd auto/ && ( test -e Makefile || /yocto/work001/fnst/huangqy/work_qt/build/tmp/work/i586-p
oky-linux/qtxmlpatterns/5.8.0+gitAUTOINC+9f7e01b582-r0/recipe-sysroot-native/usr/bin/qt5/qmake -o M
akefile /yocto/work001/fnst/huangqy/work_qt/build/tmp/work/i586-poky-linux/qtxmlpatterns/5.8.0+gitA
UTOINC+9f7e01b582-r0/git/tests/auto/auto.pro ) && make -f Makefile
Project ERROR: Could not find feature xml-schema.
Makefile:42: recipe for target 'sub-auto-make_first' failed
Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | recipes-qt/qt5/qt5-ptest.inc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qt5-ptest.inc b/recipes-qt/qt5/qt5-ptest.inc new file mode 100644 index 00000000..49d44acb --- /dev/null +++ b/recipes-qt/qt5/qt5-ptest.inc | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | SRC_URI += "file://run-ptest" | ||
| 2 | |||
| 3 | inherit ptest | ||
| 4 | |||
| 5 | addtask do_populate_sysroot after do_install before do_compile_ptest_base | ||
| 6 | deltask do_compile_ptest_base | ||
| 7 | addtask do_compile_ptest_base after do_populate_sysroot before do_install_ptest | ||
| 8 | addtask do_install_ptest after do_compile_ptest_base before do_package | ||
| 9 | |||
| 10 | do_compile_ptest() { | ||
| 11 | cd ${S}/tests | ||
| 12 | qmake -o Makefile tests.pro | ||
| 13 | oe_runmake | ||
| 14 | } | ||
| 15 | |||
| 16 | do_populate_sysroot_append() { | ||
| 17 | workdir = d.getVar('WORKDIR') | ||
| 18 | srcdir = workdir + '/sysroot-destdir/usr/' | ||
| 19 | destdir = workdir + '/recipe-sysroot/usr/' | ||
| 20 | |||
| 21 | def copyFiles(sourceDir, targetDir, filelist): | ||
| 22 | for file in os.listdir(sourceDir): | ||
| 23 | sourceFile = os.path.join(sourceDir, file) | ||
| 24 | targetFile = os.path.join(targetDir, file) | ||
| 25 | filelist.append(targetFile) #record the file list | ||
| 26 | if os.path.isfile(sourceFile): | ||
| 27 | if not os.path.exists(targetDir): | ||
| 28 | os.makedirs(targetDir) | ||
| 29 | if not os.path.exists(targetFile) or(os.path.exists(targetFile) and (os.path.getsize(targetFile) != os.path.getsize(sourceFile))): | ||
| 30 | open(targetFile, "wb").write(open(sourceFile, "rb").read()) | ||
| 31 | if os.path.isdir(sourceFile): | ||
| 32 | First_Directory = False | ||
| 33 | copyFiles(sourceFile, targetFile, filelist) | ||
| 34 | |||
| 35 | if os.path.exists(destdir): | ||
| 36 | Tmpfilelist = [] | ||
| 37 | copyFiles(srcdir, destdir, Tmpfilelist) | ||
| 38 | |||
| 39 | fp=open(workdir + '/filelist', 'w') | ||
| 40 | for i in Tmpfilelist: | ||
| 41 | fp.write(i) | ||
| 42 | fp.write("\n") | ||
| 43 | fp.close() | ||
| 44 | } | ||
| 45 | |||
| 46 | fakeroot do_install_ptest() { | ||
| 47 | mkdir -p ${D}${PTEST_PATH} | ||
| 48 | t=${D}${PTEST_PATH} | ||
| 49 | for var in ` find ${S}/tests/auto/ -name tst_*`; do | ||
| 50 | if [ -z ` echo ${var##*/} | grep '\.'` ]; then | ||
| 51 | echo ${var##*/} >> ${t}/tst_list | ||
| 52 | install -m 0644 ${var} ${t} | ||
| 53 | fi | ||
| 54 | done | ||
| 55 | for file in `cat ${WORKDIR}/filelist`; do | ||
| 56 | if [ -f $file ]; then | ||
| 57 | rm -f $file | ||
| 58 | fi | ||
| 59 | done | ||
| 60 | rm -f ${WORKDIR}/filelist | ||
| 61 | } | ||
| 62 | |||
