Changeset a2f2fda for tests/pybin


Ignore:
Timestamp:
Nov 3, 2020, 5:29:45 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a3f5208a
Parents:
daefe93
Message:

Finished support for running tests for new and old ast

Location:
tests/pybin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    rdaefe93 ra2f2fda  
    8585        def filter(self, tests):
    8686                return [test for test in tests if not test.arch or self.target == test.arch]
    87                 return True if not arch else self.target == arch
    8887
    8988        @staticmethod
     
    101100        def __init__(self, ast):
    102101                if ast == "new":
     102                        self.target = ast
    103103                        self.string = "New AST"
    104104                        self.flags  = """AST_FLAGS=-XCFA,--new-ast"""
    105105                elif ast == "old":
     106                        self.target = ast
    106107                        self.string = "Old AST"
    107108                        self.flags  = """AST_FLAGS=-XCFA,--old-ast"""
    108109                elif ast == None:
    109                         self.string = "Default AST (%s)" % ("new" if config.NEWAST else "old")
     110                        self.target = "new" if config.NEWAST else "old"
     111                        self.string = "Default AST (%s)" % self.target
    110112                        self.flags  = """AST_FLAGS="""
    111113                else:
    112114                        print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
     115                        sys.exit(1)
     116
     117        def filter(self, tests):
     118
     119                return [test for test in tests if not test.astv or self.target == test.astv]
    113120
    114121class Install:
  • tests/pybin/test_run.py

    rdaefe93 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):
     
    4548
    4649        @staticmethod
    47         def new_target(target, arch):
     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)
    5154                test.arch = arch.target if arch else ''
     55                test.astv = astv.target if astv else ''
    5256                return test
    5357
Note: See TracChangeset for help on using the changeset viewer.