diff options
author | Arnout Vandecappelle <arnout@mind.be> | 2017-07-10 01:21:20 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-07-10 17:46:25 +0200 |
commit | b78b50465c20c1733753a8dd47945cf80c9155f8 (patch) | |
tree | 21506aea6b65afbd86b00c4ba49dc59af40dc079 /support/testing | |
parent | 73e7bcdd87f72fb186c7f9bba11a44f93cf8c1a6 (diff) | |
download | buildroot-b78b50465c20c1733753a8dd47945cf80c9155f8.tar.gz buildroot-b78b50465c20c1733753a8dd47945cf80c9155f8.zip |
support/testing: move BRTest initialisation to __init__
BRTest's setUp() method contains a few assignments that initialize its
member variables. Since we will want to use these in test case
overrides, move them to the __init__ function.
Also allow the config member to be overridden, rather than always
taking the class member.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/testing')
-rw-r--r-- | support/testing/infra/basetest.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index d75458a02c..2a5c9ec939 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -36,15 +36,18 @@ class BRTest(unittest.TestCase): keepbuilds = False jlevel = None + def __init__(self, names): + super(BRTest, self).__init__(names) + self.testname = self.__class__.__name__ + self.builddir = os.path.join(self.__class__.outputdir, self.testname) + self.emulator = None + def show_msg(self, msg): print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"), self.testname, msg) def setUp(self): - self.testname = self.__class__.__name__ - self.builddir = os.path.join(self.__class__.outputdir, self.testname) - self.emulator = None self.show_msg("Starting") - config = self.__class__.config + config = self.config if self.jlevel: config += "BR2_JLEVEL={}\n".format(self.jlevel) self.b = Builder(config, self.builddir, self.logtofile) |