| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 default=False, action="store_true") | 1071 default=False, action="store_true") |
| 1072 result.add_option("-s", "--suite", help="A test suite", | 1072 result.add_option("-s", "--suite", help="A test suite", |
| 1073 default=[], action="append") | 1073 default=[], action="append") |
| 1074 result.add_option("-t", "--timeout", help="Timeout in seconds", | 1074 result.add_option("-t", "--timeout", help="Timeout in seconds", |
| 1075 default=60, type="int") | 1075 default=60, type="int") |
| 1076 result.add_option("--arch", help='The architecture to run tests for', | 1076 result.add_option("--arch", help='The architecture to run tests for', |
| 1077 default='none') | 1077 default='none') |
| 1078 result.add_option("--simulator", help="Run tests with architecture simulator", | 1078 result.add_option("--simulator", help="Run tests with architecture simulator", |
| 1079 default='none') | 1079 default='none') |
| 1080 result.add_option("--special-command", default=None) | 1080 result.add_option("--special-command", default=None) |
| 1081 result.add_option("--valgrind", help="Run tests through valgrind", |
| 1082 default=False, action="store_true") |
| 1081 result.add_option("--cat", help="Print the source of the tests", | 1083 result.add_option("--cat", help="Print the source of the tests", |
| 1082 default=False, action="store_true") | 1084 default=False, action="store_true") |
| 1083 result.add_option("--warn-unused", help="Report unused rules", | 1085 result.add_option("--warn-unused", help="Report unused rules", |
| 1084 default=False, action="store_true") | 1086 default=False, action="store_true") |
| 1085 result.add_option("-j", help="The number of parallel tasks to run", | 1087 result.add_option("-j", help="The number of parallel tasks to run", |
| 1086 default=1, type="int") | 1088 default=1, type="int") |
| 1087 result.add_option("--time", help="Print timing information after running", | 1089 result.add_option("--time", help="Print timing information after running", |
| 1088 default=False, action="store_true") | 1090 default=False, action="store_true") |
| 1089 result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for cra
shing tests", | 1091 result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for cra
shing tests", |
| 1090 dest="suppress_dialogs", default=True, action="store_true") | 1092 dest="suppress_dialogs", default=True, action="store_true") |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 | 1209 |
| 1208 root = LiteralTestSuite(repositories) | 1210 root = LiteralTestSuite(repositories) |
| 1209 if len(args) == 0: | 1211 if len(args) == 0: |
| 1210 paths = [SplitPath(t) for t in BUILT_IN_TESTS] | 1212 paths = [SplitPath(t) for t in BUILT_IN_TESTS] |
| 1211 else: | 1213 else: |
| 1212 paths = [ ] | 1214 paths = [ ] |
| 1213 for arg in args: | 1215 for arg in args: |
| 1214 path = SplitPath(arg) | 1216 path = SplitPath(arg) |
| 1215 paths.append(path) | 1217 paths.append(path) |
| 1216 | 1218 |
| 1219 # Check for --valgrind option. If enabled, we overwrite the special |
| 1220 # command flag with a command that uses the run-valgrind.py script. |
| 1221 if options.valgrind: |
| 1222 run_valgrind = join(workspace, "tools", "run-valgrind.py") |
| 1223 options.special_command = "python -u " + run_valgrind + " @" |
| 1224 |
| 1217 # First build the required targets | 1225 # First build the required targets |
| 1218 buildspace = abspath('.') | 1226 buildspace = abspath('.') |
| 1219 context = Context(workspace, buildspace, VERBOSE, | 1227 context = Context(workspace, buildspace, VERBOSE, |
| 1220 join(buildspace, 'shell'), | 1228 join(buildspace, 'shell'), |
| 1221 options.timeout, | 1229 options.timeout, |
| 1222 GetSpecialCommandProcessor(options.special_command), | 1230 GetSpecialCommandProcessor(options.special_command), |
| 1223 options.suppress_dialogs) | 1231 options.suppress_dialogs) |
| 1224 if options.j != 1: | 1232 if options.j != 1: |
| 1225 options.scons_flags += ['-j', str(options.j)] | 1233 options.scons_flags += ['-j', str(options.j)] |
| 1226 if not options.no_build: | 1234 if not options.no_build: |
| 1227 reqs = [ ] | 1235 reqs = [ ] |
| 1228 for path in paths: | 1236 for path in paths: |
| 1229 reqs += root.GetBuildRequirements(path, context) | 1237 reqs += root.GetBuildRequirements(path, context) |
| 1230 reqs = list(set(reqs)) | 1238 reqs = list(set(reqs)) |
| 1231 if len(reqs) > 0: | 1239 if len(reqs) > 0: |
| 1232 if not BuildRequirements(context, reqs, options.mode, options.scons_flags)
: | 1240 if not BuildRequirements(context, reqs, options.mode, options.scons_flags)
: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 for entry in timed_tests[:20]: | 1315 for entry in timed_tests[:20]: |
| 1308 t = FormatTime(entry.duration) | 1316 t = FormatTime(entry.duration) |
| 1309 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1317 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
| 1310 index += 1 | 1318 index += 1 |
| 1311 | 1319 |
| 1312 return result | 1320 return result |
| 1313 | 1321 |
| 1314 | 1322 |
| 1315 if __name__ == '__main__': | 1323 if __name__ == '__main__': |
| 1316 sys.exit(Main()) | 1324 sys.exit(Main()) |
| OLD | NEW |