Files
poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
Chen Qi 227cc78b3f oeqa/sdk: fixes related to hasPackage semantics
The current _hasPackage does a regex match when checking for the
existence of packages. This will sometimes result in unexpected
result. For example, the condition hasTargetPackage('gcc') is likely
to be always true as it matches libgcc1.

For most of the time, we should do exact match instead of regex match.
So change _hasPackage function to do that. For the current sdk test
cases, the only place that needs regex match is '^gcc-'. This is because
there's no easy way to get multilib tune arch (e.g. i686) from testdata.json
file.

Besides, packagegroup-cross-canadian-xxx and gcc-xxx should be check in
host manifest instead of the target one. So fix to use hasHostPackage.

Also, as we are doing exact match, there's no need to use r'gtk\+3',
just 'gtk+3' is enough.

(From OE-Core rev: 595e9922cdbacf84cf35cc83f0d03cace042e302)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-04 11:03:55 +01:00

38 lines
1.5 KiB
Python

import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
class GalculatorTest(OESDKTestCase):
td_vars = ['DATETIME']
@classmethod
def setUpClass(self):
if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
def test_galculator(self):
dl_dir = self.td.get('DL_DIR', None)
project = None
try:
project = SDKBuildProject(self.tc.sdk_dir + "/galculator/",
self.tc.sdk_env,
"http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2",
self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
project.download_archive()
# regenerate configure to get support for --with-libtool-sysroot
legacy_preconf=("autoreconf -i -f -I ${OECORE_TARGET_SYSROOT}/usr/share/aclocal -I m4;")
self.assertEqual(project.run_configure(extra_cmds=legacy_preconf),
0, msg="Running configure failed")
self.assertEqual(project.run_make(), 0,
msg="Running make failed")
finally:
project.clean()