summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/gtk3.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/gtk3.py')
-rw-r--r--meta/lib/oeqa/sdk/cases/gtk3.py48
1 files changed, 21 insertions, 27 deletions
diff --git a/meta/lib/oeqa/sdk/cases/gtk3.py b/meta/lib/oeqa/sdk/cases/gtk3.py
index c329c4bb86..cdaf50ed38 100644
--- a/meta/lib/oeqa/sdk/cases/gtk3.py
+++ b/meta/lib/oeqa/sdk/cases/gtk3.py
@@ -7,40 +7,34 @@
7import os 7import os
8import subprocess 8import subprocess
9import tempfile 9import tempfile
10import unittest
11 10
12from oeqa.sdk.case import OESDKTestCase 11from oeqa.sdk.cases.meson import MesonTestBase
12
13from oeqa.utils.subprocesstweak import errors_have_output 13from oeqa.utils.subprocesstweak import errors_have_output
14errors_have_output() 14errors_have_output()
15 15
16class GTK3Test(OESDKTestCase): 16class GTK3Test(MesonTestBase):
17
18 def setUp(self):
19 super().setUp()
20 self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3")
21 self.ensure_host_package("glib-2.0-utils", "libglib-2.0-utils", recipe="glib-2.0")
22
17 """ 23 """
18 Test that autotools and GTK+ 3 compiles correctly. 24 Test that autotools and GTK+ 3 compiles correctly.
19 """ 25 """
20 def setUp(self): 26 def test_libhandy(self):
21 if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \ 27 with tempfile.TemporaryDirectory(prefix="libhandy", dir=self.tc.sdk_dir) as testdir:
22 self.tc.hasTargetPackage("libgtk-3.0", multilib=True)): 28 tarball = self.fetch(testdir, self.td["DL_DIR"], "https://download.gnome.org/sources/libhandy/1.8/libhandy-1.8.3.tar.xz")
23 raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
24 if not (self.tc.hasHostPackage("nativesdk-gettext-dev") or
25 self.tc.hasHostPackage("gettext-native")):
26 raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
27
28 def test_galculator(self):
29 with tempfile.TemporaryDirectory(prefix="galculator", dir=self.tc.sdk_dir) as testdir:
30 tarball = self.fetch(testdir, self.td["DL_DIR"], "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2")
31
32 dirs = {}
33 dirs["source"] = os.path.join(testdir, "galculator-2.1.4")
34 dirs["build"] = os.path.join(testdir, "build")
35 dirs["install"] = os.path.join(testdir, "install")
36 29
37 subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) 30 sourcedir = os.path.join(testdir, "libhandy-1.8.3")
38 self.assertTrue(os.path.isdir(dirs["source"])) 31 builddir = os.path.join(testdir, "build")
39 os.makedirs(dirs["build"]) 32 installdir = os.path.join(testdir, "install")
40 33
41 self._run("cd {source} && sed -i -e '/s_preferences.*prefs;/d' src/main.c && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs)) 34 subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
42 self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs)) 35 self.assertTrue(os.path.isdir(sourcedir))
43 self._run("cd {build} && make -j".format(**dirs)) 36 os.makedirs(builddir)
44 self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
45 37
46 self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "galculator")) 38 self.build_meson(sourcedir, builddir, installdir, "-Dglade_catalog=disabled -Dintrospection=disabled -Dvapi=false")
39 self.assertTrue(os.path.isdir(installdir))
40 self.check_elf(os.path.join(installdir, "usr", "local", "lib", "libhandy-1.so"))