From 998300c5f55f61e928acfd352bc4cc24f36f8f7d Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Sun, 29 Oct 2017 12:06:01 -0200 Subject: testing/infra/builder: split configure() from build() 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 Cc: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- support/testing/infra/builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'support/testing/infra/builder.py') diff --git a/support/testing/infra/builder.py b/support/testing/infra/builder.py index 36f4801a2d..faf1eb1494 100644 --- a/support/testing/infra/builder.py +++ b/support/testing/infra/builder.py @@ -12,7 +12,7 @@ class Builder(object): 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) @@ -33,6 +33,8 @@ class Builder(object): 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) -- cgit v1.2.3