summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf/base.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-26 10:33:09 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-03 09:58:41 +0100
commit85b7b10b4a981cc17fca688e6ac592a5683a2546 (patch)
treefb7e656e0ee539db7a99b1fba953d934116bd6a3 /meta/lib/oeqa/buildperf/base.py
parent6722b0412c60d21fc988a671f4d9583bf6f06801 (diff)
downloadpoky-85b7b10b4a981cc17fca688e6ac592a5683a2546.tar.gz
oeqa.buildperf: make tests independent
Add test set-up functionality so that the individual tests do not depend on each other. This should make sure that a failure in one test does not affect the results of another test. The patch also makes it reasonable to run only a subset of the tests by using the --run-tests option. The increase in total execution time of the full suite - caused by the additional set-up steps - is insignificant because normally no additional tasks need to be run. The previous test has already done all set-up work. (From OE-Core rev: 69b3c63e32d09ea4a41b21daacdff6bf1fc447c1) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-rw-r--r--meta/lib/oeqa/buildperf/base.py7
1 files changed, 7 insertions, 0 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()