]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime: add gobject-introspection test
authorRoss Burton <ross.burton@intel.com>
Tue, 16 Jan 2018 15:01:04 +0000 (15:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 29 Jan 2018 08:49:52 +0000 (08:49 +0000)
(From OE-Core rev: 497a95b576e19e39e20ac280d0db24f51b7c9679)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/gi.py [new file with mode: 0644]

diff --git a/meta/lib/oeqa/runtime/cases/gi.py b/meta/lib/oeqa/runtime/cases/gi.py
new file mode 100644 (file)
index 0000000..19073e5
--- /dev/null
@@ -0,0 +1,15 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class GObjectIntrospectionTest(OERuntimeTestCase):
+
+    @OETestDepends(["ssh.SSHTest.test_ssh"])
+    @OEHasPackage(["python3-pygobject"])
+    def test_python(self):
+        script = """from gi.repository import GObject; print(GObject.markup_escape_text("<testing&testing>"))"""
+        status, output = self.target.run("python3 -c '%s'" % script)
+        self.assertEqual(status, 0, msg="Python failed (%s)" % (output))
+        self.assertEqual(output, "&lt;testing&amp;testing&gt;", msg="Unexpected output (%s)" % output)