From: Martin Mares Date: Mon, 10 Aug 2009 21:18:55 +0000 (+0200) Subject: More bits of compilation X-Git-Tag: python-dummy-working~79 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3f9d4a11f58763130548b04a3ff449c8d468c17a;p=eval.git More bits of compilation --- 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