Changes in tests/pybin/test_run.py [a2f2fda:f9128a5]
- File:
-
- 1 edited
-
tests/pybin/test_run.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/test_run.py
ra2f2fda rf9128a5 11 11 self.path = '' 12 12 self.arch = '' 13 self.astv = ''14 13 15 14 def toString(self): 16 return "{:25s} ({:5s} arch, {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astvelse "Any", self.target() )15 return "{:25s} ({:5s} {:s})".format( self.name, self.arch if self.arch else "Any", self.target() ) 17 16 18 17 def prepare(self): … … 21 20 22 21 def expect(self): 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)) ) 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)) ) 26 23 27 24 def error_log(self): … … 43 40 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) ) 44 41 45 @ staticmethod46 def valid_name( name):42 @classmethod 43 def valid_name(_, name): 47 44 return not name.endswith( ('.c', '.cc', '.cpp', '.cfa') ) 48 45 49 @ staticmethod50 def new_target(target, arch, astv):46 @classmethod 47 def from_target(_, target): 51 48 test = Test() 52 49 test.name = os.path.basename(target) 53 50 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR) 54 test.arch = arch.target if arch else '' 55 test.astv = astv.target if astv else '' 51 test.arch = settings.arch.target if settings.arch.cross_compile else '' 56 52 return test 57 53 … … 73 69 else : text = "FAILED with code %d" % retcode 74 70 75 text += " C%s - R%s" % ( fmtDur(duration[0]),fmtDur(duration[1]))71 text += " C%s - R%s" % (cls.fmtDur(duration[0]), cls.fmtDur(duration[1])) 76 72 return text 73 74 @classmethod 75 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.