X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fruntests.py;h=ba3b033afafec2120a6f0de85b7990774c0c14c7;hb=bc4748552ce0fc108915661b4052d2f07142f25f;hp=3947f33df976a1dc93ea145d74680426fc6bdb99;hpb=228265faeb97831124fd24f67385a538bea07abf;p=swftools.git diff --git a/lib/as3/runtests.py b/lib/as3/runtests.py index 3947f33..ba3b033 100644 --- a/lib/as3/runtests.py +++ b/lib/as3/runtests.py @@ -44,7 +44,9 @@ def check(s): 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: @@ -53,7 +55,7 @@ def check(s): 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) @@ -70,7 +72,6 @@ def runcmd(cmd,args,output,wait): fo.seek(0) output = fo.read() fo.close() - return ret,output class Test: @@ -86,14 +87,18 @@ 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 @@ -125,8 +130,10 @@ class Test: 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 "================================"