X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Ftest;h=dc79c9048d2c0dcf6826428312085ca6c3636e8d;hb=328c4aaa49aafc44551f72cb30fa5979542fa635;hp=a1856fd7d3c20c9dac64322f5734ed8fd5259858;hpb=434d5040b814eae784d080c695fe8c3d370a166b;p=swftools.git diff --git a/lib/as3/test b/lib/as3/test index a1856fd..dc79c90 100755 --- a/lib/as3/test +++ b/lib/as3/test @@ -28,6 +28,11 @@ import marshal import select from optparse import OptionParser +CMD_ARGS=[] +CMD = "./parser" +#CMD="as3compile" +CMD_ARGS=["-o","abc.swf"] + def check(s): row = None ok = 0 @@ -101,12 +106,12 @@ class Cache: try: self.milestone = marshal.load(open(self.filename_milestone, "rb")) except IOError: - self.milstone = {} + self.milestone = {} def parse_args(self): parser = OptionParser() 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 fail)",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") (options, args) = parser.parse_args() @@ -125,8 +130,12 @@ class Cache: self.runtime = 5 # allow more time if we're tagging this state self.checknum=-1 + self.checkfile=None if len(args): - self.checknum = int(args[0]) + try: + self.checknum = int(args[0]) + except ValueError: + self.checkfile = args[0] @staticmethod def load(filename): @@ -143,11 +152,15 @@ class Cache: fi.close() def highlight(self, nr, filename): + if self.checkfile and filename==self.checkfile: + return 1 return self.checknum==nr def skip_file(self, nr, filename): if self.checknum>=0 and nr!=self.checknum: return 1 + if self.checkfile and filename!=self.checkfile: + return 1 if not self.all and self.milestone.get(filename,"new")!="ok": return 1 if self.diff and self.filename2status(filename,"new")=="ok": @@ -171,7 +184,7 @@ class TestBase: def compile(self): try: os.unlink("abc.swf"); except: pass - ret,output = runcmd("./parser",[self.file],wait=cache.runtime) + ret,output = runcmd(CMD,CMD_ARGS+[self.file],wait=cache.runtime) self.compile_error = 0 self.compile_output = output self.exit_status = 0