Some test cases don't use a full build as setup, so split the build()
method into configure() and build().
It allows a test case to perform configuration at the setup stage and
the build inside the test itself.
Call this new method just before build in the BRTest base class, to keep
the current behavior for existing test cases.
This change will be needed when adding a common class to test the git
download infra.
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
if not self.b.is_finished():
self.show_msg("Building")
+ self.b.configure()
self.b.build()
self.show_msg("Building done")
self.builddir = builddir
self.logfile = infra.open_log_file(builddir, "build", logtofile)
- def build(self):
+ def configure(self):
if not os.path.isdir(self.builddir):
os.makedirs(self.builddir)
if ret != 0:
raise SystemError("Cannot olddefconfig")
+ def build(self):
+ env = {"PATH": os.environ["PATH"]}
cmd = ["make", "-C", self.builddir]
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
env=env)