From 3f9d4a11f58763130548b04a3ff449c8d468c17a Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 10 Aug 2009 23:18:55 +0200 Subject: [PATCH] More bits of compilation --- t/moe/batch.py | 12 ++++++++---- t/moe/box.py | 8 +++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/t/moe/batch.py b/t/moe/batch.py index cd0d93d..2a0ef1e 100644 --- a/t/moe/batch.py +++ b/t/moe/batch.py @@ -64,6 +64,7 @@ def locate(e, filename=None): e.log.progress(file + "\n") def compile_init(e): + e.log.progress("Compiling: ") boxdir = moe.box.setup(e) pdir = e.cfgs["TASK_DIR"] tdir = e.cfgs["TEST_DIR"] @@ -74,16 +75,19 @@ def compile_init(e): xx = os.path.join(pdir, x) e.log.verbose("Copying extra file %s\n" % xx) shutil.copyfile(xx, os.path.join(boxdir, x)) - pass def compile_run(e): moe.box.show(e, "compiler input") - rc = moe.box.run(e, e.cfgs["COMP_SANDBOX_OPTS"], e.cfgs["COMP"]) + cc = e.cfgs["COMP"] + e.log.verbose("Compilation command: %s\n" % cc) + rc = moe.box.run(e, e.cfgs["COMP_SANDBOX_OPTS"], cc) + if rc > 0: + e.log.progress("FAILED\n") + ## FIXME: fill in the status file and abort the pipeline? moe.box.show(e, "compiler output") - pass def compile_done(e): - pass + e.log.progress("OK\n") def tests(e): pass diff --git a/t/moe/box.py b/t/moe/box.py index daae267..bd02395 100644 --- a/t/moe/box.py +++ b/t/moe/box.py @@ -36,4 +36,10 @@ def show(e, msg): e.log.flush() os.system("ls -Al %s | sed 's/^/\t/'" % e.cfgs["BOXDIR"]) -def run(e, opts, +def run(e, opts, cmd): + c = e.cfgs["BOXCMD"] + " " + opts + " -- " + cmd + e.log.verbose("Sandbox: %s\n" % c) + rc = os.system(c) + if rc > 1: + raise moe.MoeErr, "Sandbox failed" + return rc -- 2.39.2