summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/assimp.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-12-07 21:25:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-08 17:17:01 +0000
commit7c34751a0d5a039aba22d933d9252b0c24cb3568 (patch)
tree4b989b55d5803c489471ac6240d9f13f0e4ee478 /meta/lib/oeqa/sdk/cases/assimp.py
parent2a2a38aa2cf90ff7cad4ff768a5f8a4dad4d35b3 (diff)
downloadpoky-7c34751a0d5a039aba22d933d9252b0c24cb3568.tar.gz
oeqa/sdk/assimp: use helpers
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/assimp.py')
-rw-r--r--meta/lib/oeqa/sdk/cases/assimp.py29
1 files changed, 1 insertions, 28 deletions
diff --git a/meta/lib/oeqa/sdk/cases/assimp.py b/meta/lib/oeqa/sdk/cases/assimp.py
index f5c7547b88..21c9106881 100644
--- a/meta/lib/oeqa/sdk/cases/assimp.py
+++ b/meta/lib/oeqa/sdk/cases/assimp.py
@@ -17,24 +17,8 @@ class BuildAssimp(OESDKTestCase):
17 self.tc.hasHostPackage("cmake-native")): 17 self.tc.hasHostPackage("cmake-native")):
18 raise unittest.SkipTest("Needs cmake") 18 raise unittest.SkipTest("Needs cmake")
19 19
20 def fetch(self, workdir, dl_dir, url, archive=None):
21 if not archive:
22 from urllib.parse import urlparse
23 archive = os.path.basename(urlparse(url).path)
24
25 if dl_dir:
26 tarball = os.path.join(dl_dir, archive)
27 if os.path.exists(tarball):
28 return tarball
29
30 tarball = os.path.join(workdir, archive)
31 subprocess.check_output(["wget", "-O", tarball, url])
32 return tarball
33
34 def test_assimp(self): 20 def test_assimp(self):
35 import tempfile 21 import tempfile
36 import oe.qa, oe.elf
37
38 with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir: 22 with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
39 dl_dir = self.td.get('DL_DIR', None) 23 dl_dir = self.td.get('DL_DIR', None)
40 tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz") 24 tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz")
@@ -48,15 +32,4 @@ class BuildAssimp(OESDKTestCase):
48 self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir)) 32 self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir))
49 self._run("cmake --build %s -- -j" % builddir) 33 self._run("cmake --build %s -- -j" % builddir)
50 self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir)) 34 self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir))
51 35 self.check_elf(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0"))
52 elf = oe.qa.ELFFile(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0"))
53 elf.open()
54
55 output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
56 target_os, target_arch = output.strip().split(":")
57 machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
58 (machine, osabi, abiversion, endian, bits) = machine_data
59
60 self.assertEqual(machine, elf.machine())
61 self.assertEqual(bits, elf.abiSize())
62 self.assertEqual(endian, elf.isLittleEndian())