Changeset 0fc91db1 for tests/pybin
- Timestamp:
- Sep 15, 2022, 3:43:02 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 597e395
- Parents:
- 79ee5b3
- Location:
- tests/pybin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
r79ee5b3 r0fc91db1 97 97 self.path = "debug" if value else "nodebug" 98 98 99 class AST:100 def __init__(self, ast):101 if ast == "new":102 self.target = ast103 self.string = "New AST"104 self.flags = """"""105 elif ast == "old":106 self.target = ast107 self.string = "Old AST"108 self.flags = """"""109 elif ast == None:110 self.target = "new" if config.NEWAST else "old"111 self.string = "Default AST (%s)" % self.target112 self.flags = """"""113 else: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]120 121 99 class Install: 122 100 def __init__(self, value): … … 141 119 142 120 def init( options ): 143 global all_ast144 121 global all_arch 145 122 global all_debug 146 123 global all_install 147 global ast148 124 global arch 149 125 global debug … … 160 136 global timeout2gdb 161 137 162 all_ast = [AST(o) for o in list(dict.fromkeys(options.ast ))] if options.ast else [AST(None)]163 138 all_arch = [Architecture(o) for o in list(dict.fromkeys(options.arch ))] if options.arch else [Architecture(None)] 164 139 all_debug = [Debug(o) for o in list(dict.fromkeys(options.debug ))] -
tests/pybin/test_run.py
r79ee5b3 r0fc91db1 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} arch: {:s})".format( self.name, self.arch if self.arch else "Any", self.target() ) 17 16 18 17 def prepare(self): … … 22 21 def expect(self): 23 22 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 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".expect", "%s%s.txt" % (self.name,arch)) ) 26 24 27 25 def error_log(self): … … 58 56 59 57 @staticmethod 60 def new_target(target, arch , astv):58 def new_target(target, arch): 61 59 test = Test() 62 60 test.name = os.path.basename(target) 63 61 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR) 64 62 test.arch = arch.target if arch else '' 65 test.astv = astv.target if astv else ''66 63 return test 67 64 -
tests/pybin/tools.py
r79ee5b3 r0fc91db1 182 182 '-s' if silent else None, 183 183 test_param, 184 settings.ast.flags,185 184 settings.arch.flags, 186 185 settings.debug.flags,
Note: See TracChangeset
for help on using the changeset viewer.