summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/selftest/buildoptions.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-02-21 14:33:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-01 12:54:24 +0000
commite53f86ba8aeb6d2e9eb259329001d27d62401072 (patch)
treef5a8a59120e5ba4b94a8968da865240680d782b0 /meta/lib/oeqa/selftest/buildoptions.py
parent37fd073526811dee6edcfbb78a1864dd37991f4d (diff)
downloadopenembedded-core-e53f86ba8aeb6d2e9eb259329001d27d62401072.tar.gz
openembedded-core-e53f86ba8aeb6d2e9eb259329001d27d62401072.tar.bz2
openembedded-core-e53f86ba8aeb6d2e9eb259329001d27d62401072.zip
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest/buildoptions.py')
-rw-r--r--meta/lib/oeqa/selftest/buildoptions.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index 28734fd1f0..568882ba8f 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -5,7 +5,7 @@ import shutil
import tempfile
from oeqa.selftest.base import oeSelfTest
from oeqa.selftest.buildhistory import BuildhistoryBase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
import oeqa.utils.ftools as ftools
from oeqa.utils.decorators import testcase
@@ -33,13 +33,15 @@ class ImageOptionsTests(oeSelfTest):
@testcase(286)
def test_ccache_tool(self):
bitbake("ccache-native")
- p = get_bb_var('SYSROOT_DESTDIR', 'ccache-native') + get_bb_var('bindir', 'ccache-native') + "/" + "ccache"
+ bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
+ p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
self.write_config('INHERIT += "ccache"')
self.add_command_to_tearDown('bitbake -c clean m4')
bitbake("m4 -f -c compile")
- res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True)
- self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile"))
+ log_compile = os.path.join(get_bb_var("WORKDIR","m4"), "temp/log.do_compile")
+ res = runCmd("grep ccache %s" % log_compile, ignore_status=True)
+ self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % log_compile)
@testcase(1435)
def test_read_only_image(self):