X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Ftest;h=c0da7a02393f1e9aa977615caa5cb522a7476d75;hb=b8aa0577aae67db4da5221459102202febc5c103;hp=dc79c9048d2c0dcf6826428312085ca6c3636e8d;hpb=328c4aaa49aafc44551f72cb30fa5979542fa635;p=swftools.git diff --git a/lib/as3/test b/lib/as3/test index dc79c90..c0da7a0 100755 --- a/lib/as3/test +++ b/lib/as3/test @@ -48,13 +48,15 @@ def check(s): return 0 i = line.index('/') try: - nr,len = int(line[3:i]),int(line[i+1:]) + nr,l = int(line[3:i]),int(line[i+1:]) except ValueError: return 0 - if nr<1 or nr>len: + if nr<1 or nr>l: return 0 if not row: - row = [0]*len + row = [0]*l + elif l != len(row): + return 0 if row[nr-1]: return 0 row[nr-1] = 1 @@ -78,15 +80,20 @@ def runcmd(cmd,args,wait): output += os.read(fi, 8192) if "[exit]" in output: break - if "rror" in output: + if "== by" in output: + ret = -33 break ret = p.poll() if ret is not None: + if cmd == "valgrind": + # valgrind never returns true + ret = 0 break time.sleep(0.1) else: os.kill(p.pid, 9) os.system("killall -9 %s >/dev/null 2>/dev/null" % cmd) + ret = -1 fo.close() if fi in select.select([fi],[],[], 0.01)[0]: @@ -113,6 +120,7 @@ class Cache: parser.add_option("-d", "--diff", dest="diff", help="Only run tests that failed the last time",action="store_true") parser.add_option("-a", "--all", dest="all", help="Run all tests (also tests expected to fail)",action="store_true") parser.add_option("-t", "--tag", dest="tag", help="Mark the current pass/fail statistic as milestone",action="store_true") + parser.add_option("-m", "--valgrind", dest="valgrind", help="Run compiler through valgrind",action="store_true") (options, args) = parser.parse_args() if args and args[0]=="add": @@ -128,6 +136,12 @@ class Cache: if self.tag: self.all = 1 self.runtime = 5 # allow more time if we're tagging this state + + if self.valgrind: + global CMD,CMD_ARGS + CMD_ARGS = [CMD] + CMD_ARGS + CMD = "valgrind" + self.runtime = 20 # allow even more time for valgrind self.checknum=-1 self.checkfile=None