diff options
author | Ross Burton <ross.burton@intel.com> | 2019-01-03 21:32:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-08 11:16:45 +0000 |
commit | f74574858f10815c38e375a5ac3ae483a8d1f0ba (patch) | |
tree | 6417705f9589f1dee9b9f95d3f7acc62b0ee5319 | |
parent | 730ffea3a188de575265a622723dbc9842fb0274 (diff) | |
download | poky-f74574858f10815c38e375a5ac3ae483a8d1f0ba.tar.gz |
oeqa/sdk/assimp: cleanup
Unify style with the other tests.
(From OE-Core rev: 545cde27b13f9d68211fd3a671182203ac47756d)
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/assimp.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/meta/lib/oeqa/sdk/cases/assimp.py b/meta/lib/oeqa/sdk/cases/assimp.py index 595f383489..a600010399 100644 --- a/meta/lib/oeqa/sdk/cases/assimp.py +++ b/meta/lib/oeqa/sdk/cases/assimp.py | |||
@@ -1,5 +1,7 @@ | |||
1 | import os, subprocess, unittest | 1 | import os |
2 | import bb | 2 | import subprocess |
3 | import tempfile | ||
4 | import unittest | ||
3 | from oeqa.sdk.case import OESDKTestCase | 5 | from oeqa.sdk.case import OESDKTestCase |
4 | 6 | ||
5 | from oeqa.utils.subprocesstweak import errors_have_output | 7 | from oeqa.utils.subprocesstweak import errors_have_output |
@@ -10,25 +12,25 @@ class BuildAssimp(OESDKTestCase): | |||
10 | Test case to build a project using cmake. | 12 | Test case to build a project using cmake. |
11 | """ | 13 | """ |
12 | 14 | ||
13 | td_vars = ['DATETIME', 'TARGET_OS', 'TARGET_ARCH'] | ||
14 | |||
15 | def setUp(self): | 15 | def setUp(self): |
16 | if not (self.tc.hasHostPackage("nativesdk-cmake") or | 16 | if not (self.tc.hasHostPackage("nativesdk-cmake") or |
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 test_assimp(self): | 20 | def test_assimp(self): |
21 | import tempfile | ||
22 | with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir: | 21 | with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir: |
23 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz") | 22 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz") |
24 | subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) | ||
25 | 23 | ||
26 | sourcedir = os.path.join(testdir, "assimp-4.1.0") | 24 | dirs = {} |
27 | builddir = os.path.join(testdir, "build") | 25 | dirs["source"] = os.path.join(testdir, "assimp-4.1.0") |
28 | installdir = os.path.join(testdir, "install") | 26 | dirs["build"] = os.path.join(testdir, "build") |
29 | bb.utils.mkdirhier(builddir) | 27 | dirs["install"] = os.path.join(testdir, "install") |
28 | |||
29 | subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) | ||
30 | self.assertTrue(os.path.isdir(dirs["source"])) | ||
31 | os.makedirs(dirs["build"]) | ||
30 | 32 | ||
31 | self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir)) | 33 | self._run("cd {build} && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON {source}".format(**dirs)) |
32 | self._run("cmake --build %s -- -j" % builddir) | 34 | self._run("cmake --build {build} -- -j".format(**dirs)) |
33 | self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir)) | 35 | self._run("cmake --build {build} --target install -- DESTDIR={install}".format(**dirs)) |
34 | self.check_elf(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0")) | 36 | self.check_elf(os.path.join(dirs["install"], "usr", "local", "lib", "libassimp.so.4.1.0")) |