1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

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>
This commit is contained in:
Mariano Lopez
2017-02-21 14:33:08 +00:00
committed by Richard Purdie
parent ef010c1a1d
commit 19d23814e4
17 changed files with 206 additions and 174 deletions
+6 -5
View File
@@ -6,7 +6,7 @@ import fnmatch
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
from oeqa.utils.decorators import testcase
class OePkgdataUtilTests(oeSelfTest):
@@ -126,10 +126,11 @@ class OePkgdataUtilTests(oeSelfTest):
curpkg = line.split(':')[0]
files[curpkg] = []
return files
base_libdir = get_bb_var('base_libdir')
libdir = get_bb_var('libdir')
includedir = get_bb_var('includedir')
mandir = get_bb_var('mandir')
bb_vars = get_bb_vars(['base_libdir', 'libdir', 'includedir', 'mandir'])
base_libdir = bb_vars['base_libdir']
libdir = bb_vars['libdir']
includedir = bb_vars['includedir']
mandir = bb_vars['mandir']
# Test recipe-space package name
result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc')
files = splitoutput(result.output)