]> mj.ucw.cz Git - moe.git/commitdiff
More bits of compilation
authorMartin Mares <mj@ucw.cz>
Mon, 10 Aug 2009 21:18:55 +0000 (23:18 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 10 Aug 2009 21:18:55 +0000 (23:18 +0200)
t/moe/batch.py
t/moe/box.py

index cd0d93dcffc93f313e1000bd9d7a0a74aadb2a62..2a0ef1e88e4d048aed6f1658e7bd3836edfe58e7 100644 (file)
@@ -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
index daae267eb39147101efcef09ea286fb57c3f1172..bd0239560b37f5bbf880d37697e14c7bed19047f 100644 (file)
@@ -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