Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/test_run.py

    rf9128a5 ra2f2fda  
    1111                self.path = ''
    1212                self.arch = ''
     13                self.astv = ''
    1314
    1415        def toString(self):
    15                 return "{:25s} ({:5s} {:s})".format( self.name, self.arch if self.arch else "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() )
    1617
    1718        def prepare(self):
     
    2021
    2122        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)) )
    2326
    2427        def error_log(self):
     
    4043                return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) )
    4144
    42         @classmethod
    43         def valid_name(_, name):
     45        @staticmethod
     46        def valid_name(name):
    4447                return not name.endswith( ('.c', '.cc', '.cpp', '.cfa') )
    4548
    46         @classmethod
    47         def from_target(_, target):
     49        @staticmethod
     50        def new_target(target, arch, astv):
    4851                test = Test()
    4952                test.name = os.path.basename(target)
    5053                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 ''
    5256                return test
    5357
     
    6973                        else :                                          text = "FAILED with code %d" % retcode
    7074
    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]))
    7276                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.