[OE-core] [PATCH 2/2] selftest/package: improve case to test debug package splitting
Hongxu Jia
hongxu.jia at windriver.com
Fri Sep 14 08:49:41 UTC 2018
Tweak recipe selftest-hardlink
- Add ${PN}-bin, ${PN}-bin-dbg
Tweak case test_gdb_hardlink_debug
- Test gdb debug package separately, verify the debug
package splitting works correctly.
[Test without commit `package.bbclass: improve auto debug package splitting order']
2018-09-14 15:58:06,233 - oe-selftest - INFO - ======================================================================
2018-09-14 15:58:06,233 - oe-selftest - INFO - FAIL: test_gdb_hardlink_debug (package.PackageTests)
2018-09-14 15:58:06,233 - oe-selftest - INFO - ----------------------------------------------------------------------
2018-09-14 15:58:06,233 - oe-selftest - INFO - Traceback (most recent call last):
File "oe-core/meta/lib/oeqa/selftest/cases/package.py", line 123, in test_gdb_hardlink_debug
self._test_gdb_debug(packages, binaries)
File "oe-core/meta/lib/oeqa/selftest/cases/package.py", line 162, in _test_gdb_debug
self.fail('GDB %s failed' % binary)
AssertionError: GDB /usr/libexec/hello3 failed
[Test without commit `package.bbclass: improve auto debug package splitting order']
Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
.../selftest-hardlink/selftest-hardlink.bb | 4 +++-
meta/lib/oeqa/selftest/cases/package.py | 27 ++++++++++++++++------
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
index 842a977..7d544b4 100644
--- a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
+++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
@@ -26,5 +26,7 @@ do_install () {
}
RDEPENDS_${PN}-gdb += "gdb"
-PACKAGES =+ "${PN}-gdb"
+PACKAGES =+ "${PN}-gdb ${PN}-bin ${PN}-bin-dbg"
FILES_${PN}-gdb = "${bindir}/gdb.sh"
+FILES_${PN}-bin-dbg = "${bindir}/.debug/*"
+
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py
index 0a88dc2..d00cd49 100644
--- a/meta/lib/oeqa/selftest/cases/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -115,9 +115,25 @@ class PackageTests(OESelftestTestCase):
# Verify gdb to read symbols from separated debug hardlink file correctly
def test_gdb_hardlink_debug(self):
- features = 'IMAGE_INSTALL_append = " selftest-hardlink"\n'
- features += 'IMAGE_INSTALL_append = " selftest-hardlink-dbg"\n'
- features += 'IMAGE_INSTALL_append = " selftest-hardlink-gdb"\n'
+ packages = ['selftest-hardlink',
+ 'selftest-hardlink-dbg',
+ 'selftest-hardlink-gdb']
+ binaries = ['/usr/libexec/hello3',
+ '/usr/libexec/hello4']
+ self._test_gdb_debug(packages, binaries)
+
+ packages = ['selftest-hardlink-bin',
+ 'selftest-hardlink-bin-dbg',
+ 'selftest-hardlink-gdb']
+ binaries = ['/usr/bin/hello1',
+ '/usr/bin/hello2']
+ self._test_gdb_debug(packages, binaries)
+
+ def _test_gdb_debug(self, packages, binaries):
+ features = ""
+ for pkg in packages:
+ features += 'IMAGE_INSTALL_append = " %s"\n' % pkg
+
self.write_config(features)
bitbake("core-image-minimal")
@@ -141,9 +157,6 @@ class PackageTests(OESelftestTestCase):
return False
with runqemu('core-image-minimal') as qemu:
- for binary in ['/usr/bin/hello1',
- '/usr/bin/hello2',
- '/usr/libexec/hello3',
- '/usr/libexec/hello4']:
+ for binary in binaries:
if not gdbtest(qemu, binary):
self.fail('GDB %s failed' % binary)
--
2.7.4
More information about the Openembedded-core
mailing list