summaryrefslogtreecommitdiffstats
path: root/support/testing/infra/basetest.py
diff options
context:
space:
mode:
authorRicardo Martincoski <ricardo.martincoski@datacom.ind.br>2019-02-05 21:25:29 -0600
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2019-02-06 10:40:15 +0100
commit0461ef4dea3d39a53894bf68697c266db2d33f5a (patch)
tree75a81cbf97d93f78b1cfebf991b024592efbaf7e /support/testing/infra/basetest.py
parente0d540bdda33c21c3c20edfa93c910a874bd4df1 (diff)
downloadbuildroot-0461ef4dea3d39a53894bf68697c266db2d33f5a.tar.gz
buildroot-0461ef4dea3d39a53894bf68697c266db2d33f5a.zip
testing/infra: Add BRConfigTest as superclass of BRTest
The git tests don't need to do a full build, they only need to do a configure and download and/or legal-info. More tests of that type will be added in the future. Therefore, we want to have a test base class that doesn't automatically do a full build in the setUp(). Add this new class as a superclass of the existing BRTest class, so we don't need to update existing tests. Only the code in run-tests that iterates over all subclasses of BRTest has to be adapted to use BRConfigTest instead. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Diffstat (limited to 'support/testing/infra/basetest.py')
-rw-r--r--support/testing/infra/basetest.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py
index e67bf1af23..a176bc328a 100644
--- a/support/testing/infra/basetest.py
+++ b/support/testing/infra/basetest.py
@@ -28,7 +28,7 @@ MINIMAL_CONFIG = \
"""
-class BRTest(unittest.TestCase):
+class BRConfigTest(unittest.TestCase):
config = None
br2_external = list()
downloaddir = None
@@ -39,10 +39,9 @@ class BRTest(unittest.TestCase):
timeout_multiplier = 1
def __init__(self, names):
- super(BRTest, self).__init__(names)
+ super(BRConfigTest, self).__init__(names)
self.testname = self.__class__.__name__
self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname)
- self.emulator = None
self.config += '\nBR2_DL_DIR="{}"\n'.format(self.downloaddir)
self.config += "\nBR2_JLEVEL={}\n".format(self.jlevel)
@@ -58,8 +57,23 @@ class BRTest(unittest.TestCase):
self.b.delete()
if not self.b.is_finished():
- self.show_msg("Building")
self.b.configure(make_extra_opts=["BR2_EXTERNAL={}".format(":".join(self.br2_external))])
+
+ def tearDown(self):
+ self.show_msg("Cleaning up")
+ if self.b and not self.keepbuilds:
+ self.b.delete()
+
+
+class BRTest(BRConfigTest):
+ def __init__(self, names):
+ super(BRTest, self).__init__(names)
+ self.emulator = None
+
+ def setUp(self):
+ super(BRTest, self).setUp()
+ if not self.b.is_finished():
+ self.show_msg("Building")
self.b.build()
self.show_msg("Building done")
@@ -67,8 +81,6 @@ class BRTest(unittest.TestCase):
self.logtofile, self.timeout_multiplier)
def tearDown(self):
- self.show_msg("Cleaning up")
if self.emulator:
self.emulator.stop()
- if self.b and not self.keepbuilds:
- self.b.delete()
+ super(BRTest, self).tearDown()
OpenPOWER on IntegriCloud