Skip to contentSkip to conversation

qt5: refactor ptest

PATCH New Samuli Piippo 1 participant 1 message Feb 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 recipes-qt/qt5/{qtbase => ptest}/run-ptest |  0
 recipes-qt/qt5/qt5-ptest.inc               | 51 +++---------------------------
 recipes-qt/qt5/qtbase_git.bb               | 15 +--------
 recipes-qt/qt5/qtdeclarative/run-ptest     |  5 ---
 recipes-qt/qt5/qtquick1/run-ptest          |  6 ----
 recipes-qt/qt5/qttools_git.bb              | 15 ++-------
 recipes-qt/qt5/qtxmlpatterns/run-ptest     |  6 ----
 7 files changed, 9 insertions(+), 89 deletions(-)
 rename recipes-qt/qt5/{qtbase => ptest}/run-ptest (100%)
 delete mode 100644 recipes-qt/qt5/qtdeclarative/run-ptest
 delete mode 100644 recipes-qt/qt5/qtquick1/run-ptest
 delete mode 100644 recipes-qt/qt5/qtxmlpatterns/run-ptest
recipes-qt/qt5/ptest/run-ptest renamed from recipes-qt/qt5/qtbase/run-ptest +0 -0
similarity index 100%
rename from recipes-qt/qt5/qtbase/run-ptest
rename to recipes-qt/qt5/ptest/run-ptest
recipes-qt/qt5/qt5-ptest.inc +5 -46

68 lines not on this page · raw message

recipes-qt/qt5/qtbase_git.bb +1 -14
index 4f3ade2..f586409 100644
@@ -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
@@ -203,17 +201,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
recipes-qt/qt5/qtdeclarative/run-ptest deleted +0 -5
deleted file mode 100644
index 6c3f522..0000000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
-    ./${x};
-done
recipes-qt/qt5/qtquick1/run-ptest deleted +0 -6
deleted file mode 100644
index 044f834..0000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
-    ./${x};
-done
-
recipes-qt/qt5/qttools_git.bb +3 -12
index 2187f9c..dad5ba8 100644
@@ -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.10
 # 5.10.meta-qt5.1
 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 = "3ce89dc37d3c73033c18dcec9e4710afd747ce01"
 
 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
 }
recipes-qt/qt5/qtxmlpatterns/run-ptest deleted +0 -6
deleted file mode 100644
index 044f834..0000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for x in ` awk '{print $1}' tst_list `;do
-    ./${x};
-done
-
Signature · 1 line
2.16.1