From b6bbb0782a13e49c43199a335bc51447b78f62d3 Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Sun, 23 Jul 2017 18:44:18 -0300 Subject: [PATCH] testing/infra/basetest: move jlevel logic to constructor As suggested by Arnout in [1]. While at it, simplify the logic by always appending the BR2_JLEVEL and defaulting to 0 (the value copied from Config.in is used for 5 years now and is very unlikely to change). [1] http://patchwork.ozlabs.org/patch/790525/ Suggested-by: Arnout Vandecappelle Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle Tested-by: "Yann E. MORIN" Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- support/testing/infra/basetest.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index 29e7872572..431605b23f 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -34,7 +34,7 @@ class BRTest(unittest.TestCase): outputdir = None logtofile = True keepbuilds = False - jlevel = None + jlevel = 0 def __init__(self, names): super(BRTest, self).__init__(names) @@ -43,16 +43,14 @@ class BRTest(unittest.TestCase): self.emulator = None self.config = '\n'.join([line.lstrip() for line in self.config.splitlines()]) + '\n' + self.config += "BR2_JLEVEL={}\n".format(self.jlevel) def show_msg(self, msg): print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"), self.testname, msg) def setUp(self): self.show_msg("Starting") - config = self.config - if self.jlevel: - config += "BR2_JLEVEL={}\n".format(self.jlevel) - self.b = Builder(config, self.builddir, self.logtofile) + self.b = Builder(self.config, self.builddir, self.logtofile) if not self.keepbuilds: self.b.delete() -- 2.30.2