Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: tools/run-tests.py

Issue 98963002: 'make quickcheck': don't overwrite debug output. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 help="Don't run any testing variants", 140 help="Don't run any testing variants",
141 default=False, dest="no_variants", action="store_true") 141 default=False, dest="no_variants", action="store_true")
142 result.add_option("--variants", 142 result.add_option("--variants",
143 help="Comma-separated list of testing variants") 143 help="Comma-separated list of testing variants")
144 result.add_option("--outdir", help="Base directory with compile output", 144 result.add_option("--outdir", help="Base directory with compile output",
145 default="out") 145 default="out")
146 result.add_option("-p", "--progress", 146 result.add_option("-p", "--progress",
147 help=("The style of progress indicator" 147 help=("The style of progress indicator"
148 " (verbose, dots, color, mono)"), 148 " (verbose, dots, color, mono)"),
149 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") 149 choices=progress.PROGRESS_INDICATORS.keys(), default="mono")
150 result.add_option("--quickcheck", default=False, action="store_true",
151 help=("Quick check mode (skip slow/flaky tests)"))
150 result.add_option("--report", help="Print a summary of the tests to be run", 152 result.add_option("--report", help="Print a summary of the tests to be run",
151 default=False, action="store_true") 153 default=False, action="store_true")
152 result.add_option("--shard-count", 154 result.add_option("--shard-count",
153 help="Split testsuites into this number of shards", 155 help="Split testsuites into this number of shards",
154 default=1, type="int") 156 default=1, type="int")
155 result.add_option("--shard-run", 157 result.add_option("--shard-run",
156 help="Run this shard from the split up tests.", 158 help="Run this shard from the split up tests.",
157 default=1, type="int") 159 default=1, type="int")
158 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="") 160 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="")
159 result.add_option("--shell-dir", help="Directory containing executables", 161 result.add_option("--shell-dir", help="Directory containing executables",
(...skipping 23 matching lines...) Expand all
183 global VARIANTS 185 global VARIANTS
184 186
185 # Architecture and mode related stuff. 187 # Architecture and mode related stuff.
186 if options.arch_and_mode: 188 if options.arch_and_mode:
187 options.arch_and_mode = [arch_and_mode.split(".") 189 options.arch_and_mode = [arch_and_mode.split(".")
188 for arch_and_mode in options.arch_and_mode.split(",")] 190 for arch_and_mode in options.arch_and_mode.split(",")]
189 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) 191 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode])
190 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) 192 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode])
191 options.mode = options.mode.split(",") 193 options.mode = options.mode.split(",")
192 for mode in options.mode: 194 for mode in options.mode:
193 if not mode.lower() in ["debug", "release"]: 195 if not mode.lower() in ["debug", "release", "optdebug"]:
194 print "Unknown mode %s" % mode 196 print "Unknown mode %s" % mode
195 return False 197 return False
196 if options.arch in ["auto", "native"]: 198 if options.arch in ["auto", "native"]:
197 options.arch = ARCH_GUESS 199 options.arch = ARCH_GUESS
198 options.arch = options.arch.split(",") 200 options.arch = options.arch.split(",")
199 for arch in options.arch: 201 for arch in options.arch:
200 if not arch in SUPPORTED_ARCHS: 202 if not arch in SUPPORTED_ARCHS:
201 print "Unknown architecture %s" % arch 203 print "Unknown architecture %s" % arch
202 return False 204 return False
203 205
(...skipping 15 matching lines...) Expand all
219 options.command_prefix = shlex.split(options.command_prefix) 221 options.command_prefix = shlex.split(options.command_prefix)
220 options.extra_flags = shlex.split(options.extra_flags) 222 options.extra_flags = shlex.split(options.extra_flags)
221 if options.j == 0: 223 if options.j == 0:
222 options.j = multiprocessing.cpu_count() 224 options.j = multiprocessing.cpu_count()
223 225
224 def excl(*args): 226 def excl(*args):
225 """Returns true if zero or one of multiple arguments are true.""" 227 """Returns true if zero or one of multiple arguments are true."""
226 return reduce(lambda x, y: x + y, args) <= 1 228 return reduce(lambda x, y: x + y, args) <= 1
227 229
228 if not excl(options.no_stress, options.stress_only, options.no_variants, 230 if not excl(options.no_stress, options.stress_only, options.no_variants,
229 bool(options.variants)): 231 bool(options.variants), options.quickcheck):
230 print("Use only one of --no-stress, --stress-only, --no-variants or " 232 print("Use only one of --no-stress, --stress-only, --no-variants, "
231 "--variants.") 233 "--variants, or --quickcheck.")
232 return False 234 return False
233 if options.no_stress: 235 if options.no_stress:
234 VARIANTS = ["default", "nocrankshaft"] 236 VARIANTS = ["default", "nocrankshaft"]
235 if options.no_variants: 237 if options.no_variants:
236 VARIANTS = ["default"] 238 VARIANTS = ["default"]
237 if options.stress_only: 239 if options.stress_only:
238 VARIANTS = ["stress"] 240 VARIANTS = ["stress"]
239 if options.variants: 241 if options.variants:
240 VARIANTS = options.variants.split(",") 242 VARIANTS = options.variants.split(",")
241 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()): 243 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()):
242 print "All variants must be in %s" % str(VARIANT_FLAGS.keys()) 244 print "All variants must be in %s" % str(VARIANT_FLAGS.keys())
243 return False 245 return False
246 if options.quickcheck:
247 VARIANTS = ["default", "stress"]
248 options.flaky_tests = "skip"
249 options.slow_tests = "skip"
250 options.pass_fail_tests = "skip"
251
244 if not options.shell_dir: 252 if not options.shell_dir:
245 if options.shell: 253 if options.shell:
246 print "Warning: --shell is deprecated, use --shell-dir instead." 254 print "Warning: --shell is deprecated, use --shell-dir instead."
247 options.shell_dir = os.path.dirname(options.shell) 255 options.shell_dir = os.path.dirname(options.shell)
248 if options.valgrind: 256 if options.valgrind:
249 run_valgrind = os.path.join("tools", "run-valgrind.py") 257 run_valgrind = os.path.join("tools", "run-valgrind.py")
250 # This is OK for distributed running, so we don't need to set no_network. 258 # This is OK for distributed running, so we don't need to set no_network.
251 options.command_prefix = (["python", "-u", run_valgrind] + 259 options.command_prefix = (["python", "-u", run_valgrind] +
252 options.command_prefix) 260 options.command_prefix)
253 def CheckTestMode(name, option): 261 def CheckTestMode(name, option):
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 shell_dir = options.shell_dir 340 shell_dir = options.shell_dir
333 if not shell_dir: 341 if not shell_dir:
334 if options.buildbot: 342 if options.buildbot:
335 shell_dir = os.path.join(workspace, options.outdir, mode) 343 shell_dir = os.path.join(workspace, options.outdir, mode)
336 mode = mode.lower() 344 mode = mode.lower()
337 else: 345 else:
338 shell_dir = os.path.join(workspace, options.outdir, 346 shell_dir = os.path.join(workspace, options.outdir,
339 "%s.%s" % (arch, mode)) 347 "%s.%s" % (arch, mode))
340 shell_dir = os.path.relpath(shell_dir) 348 shell_dir = os.path.relpath(shell_dir)
341 349
350 if mode == "optdebug":
351 mode = "debug" # "optdebug" is just an alias.
352
342 # Populate context object. 353 # Populate context object.
343 mode_flags = MODE_FLAGS[mode] 354 mode_flags = MODE_FLAGS[mode]
344 timeout = options.timeout 355 timeout = options.timeout
345 if timeout == -1: 356 if timeout == -1:
346 # Simulators are slow, therefore allow a longer default timeout. 357 # Simulators are slow, therefore allow a longer default timeout.
347 if arch in SLOW_ARCHS: 358 if arch in SLOW_ARCHS:
348 timeout = 2 * TIMEOUT_DEFAULT; 359 timeout = 2 * TIMEOUT_DEFAULT;
349 else: 360 else:
350 timeout = TIMEOUT_DEFAULT; 361 timeout = TIMEOUT_DEFAULT;
351 362
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 except KeyboardInterrupt: 451 except KeyboardInterrupt:
441 return 1 452 return 1
442 453
443 if options.time: 454 if options.time:
444 verbose.PrintTestDurations(suites, overall_duration) 455 verbose.PrintTestDurations(suites, overall_duration)
445 return exit_code 456 return exit_code
446 457
447 458
448 if __name__ == "__main__": 459 if __name__ == "__main__":
449 sys.exit(Main()) 460 sys.exit(Main())
OLDNEW
« no previous file with comments | « Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698