summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/buildperf/base.py7
-rw-r--r--meta/lib/oeqa/buildperf/test_basic.py10
2 files changed, 14 insertions, 3 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index e4a79486f2..83439f1bdb 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -257,6 +257,7 @@ class BuildPerfTestCase(unittest.TestCase):
257 """Base class for build performance tests""" 257 """Base class for build performance tests"""
258 SYSRES = 'sysres' 258 SYSRES = 'sysres'
259 DISKUSAGE = 'diskusage' 259 DISKUSAGE = 'diskusage'
260 build_target = None
260 261
261 def __init__(self, *args, **kwargs): 262 def __init__(self, *args, **kwargs):
262 super(BuildPerfTestCase, self).__init__(*args, **kwargs) 263 super(BuildPerfTestCase, self).__init__(*args, **kwargs)
@@ -271,6 +272,12 @@ class BuildPerfTestCase(unittest.TestCase):
271 self.times = [] 272 self.times = []
272 self.sizes = [] 273 self.sizes = []
273 274
275 def setUp(self):
276 """Set-up fixture for each test"""
277 if self.build_target:
278 self.log_cmd_output(['bitbake', self.build_target,
279 '-c', 'fetchall'])
280
274 def run(self, *args, **kwargs): 281 def run(self, *args, **kwargs):
275 """Run test""" 282 """Run test"""
276 self.start_time = datetime.now() 283 self.start_time = datetime.now()
diff --git a/meta/lib/oeqa/buildperf/test_basic.py b/meta/lib/oeqa/buildperf/test_basic.py
index 9310f3d86a..25dbfb0bf7 100644
--- a/meta/lib/oeqa/buildperf/test_basic.py
+++ b/meta/lib/oeqa/buildperf/test_basic.py
@@ -23,7 +23,6 @@ class Test1P1(BuildPerfTestCase):
23 23
24 def test1(self): 24 def test1(self):
25 """Measure wall clock of bitbake core-image-sato and size of tmp dir""" 25 """Measure wall clock of bitbake core-image-sato and size of tmp dir"""
26 self.log_cmd_output("bitbake {} -c fetchall".format(self.build_target))
27 self.rm_tmp() 26 self.rm_tmp()
28 self.rm_sstate() 27 self.rm_sstate()
29 self.rm_cache() 28 self.rm_cache()
@@ -39,8 +38,10 @@ class Test1P2(BuildPerfTestCase):
39 38
40 def test12(self): 39 def test12(self):
41 """Measure bitbake virtual/kernel""" 40 """Measure bitbake virtual/kernel"""
42 self.log_cmd_output("bitbake {} -c cleansstate".format( 41 # Build and cleans state in order to get all dependencies pre-built
43 self.build_target)) 42 self.log_cmd_output(['bitbake', self.build_target])
43 self.log_cmd_output(['bitbake', self.build_target, '-c', 'cleansstate'])
44
44 self.sync() 45 self.sync()
45 self.measure_cmd_resources(['bitbake', self.build_target], 'build', 46 self.measure_cmd_resources(['bitbake', self.build_target], 'build',
46 'bitbake ' + self.build_target) 47 'bitbake ' + self.build_target)
@@ -73,6 +74,9 @@ class Test2(BuildPerfTestCase):
73 74
74 def test2(self): 75 def test2(self):
75 """Measure bitbake core-image-sato -c rootfs with sstate""" 76 """Measure bitbake core-image-sato -c rootfs with sstate"""
77 # Build once in order to populate sstate cache
78 self.log_cmd_output(['bitbake', self.build_target])
79
76 self.rm_tmp() 80 self.rm_tmp()
77 self.rm_cache() 81 self.rm_cache()
78 self.sync() 82 self.sync()