summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-12-20 15:38:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-08 11:16:45 +0000
commit4dd51032160897be4132242d6aaaf4dd1e5167da (patch)
tree76e124acd11ea555f4885b16a6c6105ec81d5891
parentf74574858f10815c38e375a5ac3ae483a8d1f0ba (diff)
downloadpoky-4dd51032160897be4132242d6aaaf4dd1e5167da.tar.gz
oeqa/sdk: add test to exercise Meson
(From OE-Core rev: 29359493e391d68a5a6b4fa4d09ffdc1fe6db620) (From OE-Core rev: 237ed166f48b0e32684a5307d3b47b9485238ed9) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/sdk/cases/buildepoxy.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildepoxy.py b/meta/lib/oeqa/sdk/cases/buildepoxy.py
new file mode 100644
index 0000000000..ef24b4f4ac
--- /dev/null
+++ b/meta/lib/oeqa/sdk/cases/buildepoxy.py
@@ -0,0 +1,35 @@
1import os
2import subprocess
3import tempfile
4import unittest
5
6from oeqa.sdk.case import OESDKTestCase
7from oeqa.utils.subprocesstweak import errors_have_output
8errors_have_output()
9
10class EpoxyTest(OESDKTestCase):
11 """
12 Test that Meson builds correctly.
13 """
14 def setUp(self):
15 if not (self.tc.hasHostPackage("nativesdk-meson")):
16 raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain Meson")
17
18 def test_epoxy(self):
19 with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir:
20 tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/anholt/libepoxy/releases/download/1.5.3/libepoxy-1.5.3.tar.xz")
21
22 dirs = {}
23 dirs["source"] = os.path.join(testdir, "libepoxy-1.5.3")
24 dirs["build"] = os.path.join(testdir, "build")
25 dirs["install"] = os.path.join(testdir, "install")
26
27 subprocess.check_output(["tar", "xf", tarball, "-C", testdir])
28 self.assertTrue(os.path.isdir(dirs["source"]))
29 os.makedirs(dirs["build"])
30
31 self._run("meson -Degl=no -Dglx=no -Dx11=false {build} {source}".format(**dirs))
32 self._run("ninja -C {build} -v".format(**dirs))
33 self._run("DESTDIR={install} ninja -C {build} -v install".format(**dirs))
34
35 self.check_elf(os.path.join(dirs["install"], "usr", "local", "lib", "libepoxy.so"))