return 0
if not row:
row = [0]*len
- row[nr-1] = len
+ if row[nr-1]:
+ return 0
+ row[nr-1] = 1
elif line == "ok":
ok = 1
if ok:
return 0 not in row
return 0
-def runcmd(cmd,args,output,wait):
+def runcmd(cmd,args,wait):
#fo = open(tempfile, "wb")
fo= os.tmpfile()
p = subprocess.Popen([cmd] + args, executable=cmd, stdout=fo, stderr=fo)
fo.seek(0)
output = fo.read()
fo.close()
-
return ret,output
class Test:
self.run()
def compile(self):
- ret,output = runcmd("./parser",[self.file],"/tmp/abctest.txt",wait=60)
+ try: os.unlink("abc.swf");
+ except: pass
+ ret,output = runcmd("./parser",[self.file],wait=60)
self.compile_error = 0
self.compile_output = output
- if ret&0xff00:
+ if ret:
+ self.compile_error = 1
+ if not os.path.isfile("abc.swf"):
self.compile_error = 1
def run(self):
- ret,output = runcmd("flashplayer",["abc.swf"],"/tmp/abctest.txt",wait=1)
+ ret,output = runcmd("flashplayer",["abc.swf"],wait=1)
os.system("killall flashplayer")
self.flash_output = output
def doprintlong(self):
print self.nr, self.file
print "================================"
+ print "compile:", (test.compile_error and "error" or "ok")
print test.compile_output
print "================================"
+ print "run:", (test.flash_error and "error" or "ok")
print test.flash_output
print "================================"