Changeset a2f2fda for tests/pybin
- Timestamp:
- Nov 3, 2020, 5:29:45 PM (4 years ago)
- 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
- Location:
- tests/pybin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
rdaefe93 ra2f2fda 85 85 def filter(self, tests): 86 86 return [test for test in tests if not test.arch or self.target == test.arch] 87 return True if not arch else self.target == arch88 87 89 88 @staticmethod … … 101 100 def __init__(self, ast): 102 101 if ast == "new": 102 self.target = ast 103 103 self.string = "New AST" 104 104 self.flags = """AST_FLAGS=-XCFA,--new-ast""" 105 105 elif ast == "old": 106 self.target = ast 106 107 self.string = "Old AST" 107 108 self.flags = """AST_FLAGS=-XCFA,--old-ast""" 108 109 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 110 112 self.flags = """AST_FLAGS=""" 111 113 else: 112 114 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] 113 120 114 121 class Install: -
tests/pybin/test_run.py
rdaefe93 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): … … 45 48 46 49 @staticmethod 47 def new_target(target, arch ):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 54 test.arch = arch.target if arch else '' 55 test.astv = astv.target if astv else '' 52 56 return test 53 57
Note: See TracChangeset
for help on using the changeset viewer.