mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-23 19:26:32 +00:00
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 <arnout@mind.be> Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
78c8958619
commit
b6bbb0782a
@ -34,7 +34,7 @@ class BRTest(unittest.TestCase):
|
|||||||
outputdir = None
|
outputdir = None
|
||||||
logtofile = True
|
logtofile = True
|
||||||
keepbuilds = False
|
keepbuilds = False
|
||||||
jlevel = None
|
jlevel = 0
|
||||||
|
|
||||||
def __init__(self, names):
|
def __init__(self, names):
|
||||||
super(BRTest, self).__init__(names)
|
super(BRTest, self).__init__(names)
|
||||||
@ -43,16 +43,14 @@ class BRTest(unittest.TestCase):
|
|||||||
self.emulator = None
|
self.emulator = None
|
||||||
self.config = '\n'.join([line.lstrip() for line in
|
self.config = '\n'.join([line.lstrip() for line in
|
||||||
self.config.splitlines()]) + '\n'
|
self.config.splitlines()]) + '\n'
|
||||||
|
self.config += "BR2_JLEVEL={}\n".format(self.jlevel)
|
||||||
|
|
||||||
def show_msg(self, msg):
|
def show_msg(self, msg):
|
||||||
print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
|
print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
|
||||||
self.testname, msg)
|
self.testname, msg)
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.show_msg("Starting")
|
self.show_msg("Starting")
|
||||||
config = self.config
|
self.b = Builder(self.config, self.builddir, self.logtofile)
|
||||||
if self.jlevel:
|
|
||||||
config += "BR2_JLEVEL={}\n".format(self.jlevel)
|
|
||||||
self.b = Builder(config, self.builddir, self.logtofile)
|
|
||||||
|
|
||||||
if not self.keepbuilds:
|
if not self.keepbuilds:
|
||||||
self.b.delete()
|
self.b.delete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user