diff --git a/recipes-qt/qt6/ptest/run-ptest b/recipes-qt/qt6/ptest/run-ptest index 1052856..0294585 100644 --- a/recipes-qt/qt6/ptest/run-ptest +++ b/recipes-qt/qt6/ptest/run-ptest @@ -1,6 +1,6 @@ #!/bin/sh -if [ ! -e tst_list ]; then +if [ ! -s tst_list ]; then echo PASS: no tests exit 0 fi diff --git a/recipes-qt/qt6/qt6-ptest.inc b/recipes-qt/qt6/qt6-ptest.inc index d2b9b4d..30833f6 100644 --- a/recipes-qt/qt6/qt6-ptest.inc +++ b/recipes-qt/qt6/qt6-ptest.inc @@ -12,66 +12,85 @@ DEBUG_PREFIX_MAP += "\ do_install_ptest_base[progress] = "${@d.getVarFlag('do_compile', 'progress')}" +B_PTEST = "${WORKDIR}/build-ptest" + fakeroot do_install_ptest() { cat >${WORKDIR}/toolchain-ptest.cmake <> ${D}${PTEST_PATH}/tst_list - done - fi + cp -r ${S}/tests/$tests ${D}${PTEST_PATH}/tests + fi + done +} + +fakeroot python do_create_ptest_list() { + import json, os, subprocess + + builddir = d.getVar('B_PTEST') + ptest_path = d.getVar('PTEST_PATH') + try: + command_output = subprocess.check_output(['ctest', '--show-only=json-v1'], cwd=builddir, text=True) + except subprocess.CalledProcessError as e: + bb.fatal('Could not get list of tests: {e.output}') + + json_data = json.loads(command_output) + tests_data = json_data.get('tests', []) + + output = d.getVar('D') + os.path.join(ptest_path, 'tst_list') + file = open(output, 'w') + + for test in tests_data: + test_name = test.get('name') + working_directory = next((prop['value'] for prop in test.get('properties', []) if prop['name'] == 'WORKING_DIRECTORY'), None) + + if test_name and working_directory: + test_executable = os.path.normpath(os.path.join(working_directory,test_name)).replace(builddir,ptest_path) + file.write(f'{test_executable}\n') + + file.close() +} + +addtask create_ptest_list after do_install_ptest_base before do_package +python () { + if not(d.getVar('PTEST_ENABLED') == "1"): + bb.build.deltask('do_create_ptest_list', d) } INSANE_SKIP:${PN}-ptest += "file-rdeps" PACKAGESPLITFUNCS =+ "remove_ptest_debug" remove_ptest_debug() { - if [ -e ${PKGD}${QT6_INSTALL_LIBDIR}/${BPN}/ptest/tests/auto ]; then - find ${PKGD}${QT6_INSTALL_LIBDIR}/${BPN}/ptest/tests/auto -depth -type d -name .debug -exec rm -rf '{}' \; + if [ -e ${PKGD}${QT6_INSTALL_LIBDIR}/${BPN}/ptest/tests ]; then + find ${PKGD}${QT6_INSTALL_LIBDIR}/${BPN}/ptest/tests -depth -type d -name .debug -exec rm -rf '{}' \; fi } diff --git a/recipes-qt/qt6/qtdeviceutilities_git.bb b/recipes-qt/qt6/qtdeviceutilities_git.bb index 6ae3835..636a624 100644 --- a/recipes-qt/qt6/qtdeviceutilities_git.bb +++ b/recipes-qt/qt6/qtdeviceutilities_git.bb @@ -2,8 +2,8 @@ LICENSE = "GPL-3.0-only | The-Qt-Company-Commercial" LIC_FILES_CHKSUM = "file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504" inherit qt6-cmake -include recipes-qt/qt6/qt6.inc include recipes-qt/qt6/qt6-git.inc +include recipes-qt/qt6/qt6.inc DEPENDS = "qtbase qtdeclarative qtdeclarative-native qtvirtualkeyboard" RDEPENDS:${PN} = "connman"