blob: ef24b4f4ac1f614e451da46f9705b93293d38155 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001import 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"))