Changes in tests/pybin/test_run.py [f9128a5:a2f2fda]
- File:
-
- 1 edited
-
tests/pybin/test_run.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/test_run.py
rf9128a5 ra2f2fda 11 11 self.path = '' 12 12 self.arch = '' 13 self.astv = '' 13 14 14 15 def toString(self): 15 return "{:25s} ({:5s} {:s})".format( self.name, self.arch if self.archelse "Any", self.target() )16 return "{:25s} ({:5s} arch, {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astv else "Any", self.target() ) 16 17 17 18 def prepare(self): … … 20 21 21 22 def expect(self): 22 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".expect", "%s%s.txt" % (self.name,'' if not self.arch else ".%s" % self.arch)) ) 23 arch = '' if not self.arch else ".%s" % self.arch 24 astv = '' if not self.astv else ".nast" if self.astv == "new" else ".oast" 25 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".expect", "%s%s%s.txt" % (self.name,astv,arch)) ) 23 26 24 27 def error_log(self): … … 40 43 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) ) 41 44 42 @ classmethod43 def valid_name( _,name):45 @staticmethod 46 def valid_name(name): 44 47 return not name.endswith( ('.c', '.cc', '.cpp', '.cfa') ) 45 48 46 @ classmethod47 def from_target(_, target):49 @staticmethod 50 def new_target(target, arch, astv): 48 51 test = Test() 49 52 test.name = os.path.basename(target) 50 53 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR) 51 test.arch = settings.arch.target if settings.arch.cross_compile else '' 54 test.arch = arch.target if arch else '' 55 test.astv = astv.target if astv else '' 52 56 return test 53 57 … … 69 73 else : text = "FAILED with code %d" % retcode 70 74 71 text += " C%s - R%s" % ( cls.fmtDur(duration[0]), cls.fmtDur(duration[1]))75 text += " C%s - R%s" % (fmtDur(duration[0]), fmtDur(duration[1])) 72 76 return text 73 74 @classmethod75 def fmtDur( cls, duration ):76 if duration :77 hours, rem = divmod(duration, 3600)78 minutes, rem = divmod(rem, 60)79 seconds, millis = divmod(rem, 1)80 return "%2d:%02d.%03d" % (minutes, seconds, millis * 1000)81 return " n/a"
Note:
See TracChangeset
for help on using the changeset viewer.