diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2017-02-21 14:33:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:10 +0000 |
commit | 19d23814e449101f57c8f149c77ee8697c636f43 (patch) | |
tree | d6e79252c334f3f71caff686423cfa52ff2327a5 /meta/lib/oeqa/selftest/manifest.py | |
parent | ef010c1a1d823870aba80152fc13c32c62e95146 (diff) | |
download | poky-19d23814e449101f57c8f149c77ee8697c636f43.tar.gz |
selftest: Optimize get_bb_var use
get_bb_var calls bitbake every time it is used and every call
would take about 7 seconds. There are tests that calls get_bb_var
several times when they can use get_bb_vars. Also there are tests
that calls it to fetch the same variable over and over again.
This will optimize the use of get_bb_var and get_bb_vars for a
little speed up in the tests.
[YOCTO #11037]
(From OE-Core rev: e53f86ba8aeb6d2e9eb259329001d27d62401072)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/manifest.py')
-rw-r--r-- | meta/lib/oeqa/selftest/manifest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/manifest.py b/meta/lib/oeqa/selftest/manifest.py index 44d0404c5d..fe6f949644 100644 --- a/meta/lib/oeqa/selftest/manifest.py +++ b/meta/lib/oeqa/selftest/manifest.py | |||
@@ -2,7 +2,7 @@ import unittest | |||
2 | import os | 2 | import os |
3 | 3 | ||
4 | from oeqa.selftest.base import oeSelfTest | 4 | from oeqa.selftest.base import oeSelfTest |
5 | from oeqa.utils.commands import get_bb_var, bitbake | 5 | from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake |
6 | from oeqa.utils.decorators import testcase | 6 | from oeqa.utils.decorators import testcase |
7 | 7 | ||
8 | class ManifestEntry: | 8 | class ManifestEntry: |
@@ -84,9 +84,10 @@ class VerifyManifest(oeSelfTest): | |||
84 | try: | 84 | try: |
85 | mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget) | 85 | mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget) |
86 | for k in d_target.keys(): | 86 | for k in d_target.keys(): |
87 | bb_vars = get_bb_vars(['SDK_NAME', 'SDK_VERSION'], self.buildtarget) | ||
87 | mfilename[k] = "{}-toolchain-{}.{}.manifest".format( | 88 | mfilename[k] = "{}-toolchain-{}.{}.manifest".format( |
88 | get_bb_var("SDK_NAME", self.buildtarget), | 89 | bb_vars['SDK_NAME'], |
89 | get_bb_var("SDK_VERSION", self.buildtarget), | 90 | bb_vars['SDK_VERSION'], |
90 | k) | 91 | k) |
91 | mpath[k] = os.path.join(mdir, mfilename[k]) | 92 | mpath[k] = os.path.join(mdir, mfilename[k]) |
92 | if not os.path.isfile(mpath[k]): | 93 | if not os.path.isfile(mpath[k]): |