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

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

Issue 882983002: Add try release mode to test runner. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « no previous file | 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 "mjsunit", 74 "mjsunit",
75 "cctest", 75 "cctest",
76 "webkit", 76 "webkit",
77 ], 77 ],
78 "unittests": [ 78 "unittests": [
79 "unittests", 79 "unittests",
80 ], 80 ],
81 } 81 }
82 82
83 TIMEOUT_DEFAULT = 60 83 TIMEOUT_DEFAULT = 60
84 TIMEOUT_SCALEFACTOR = {"debug" : 4,
85 "release" : 1 }
86 84
87 VARIANTS = ["default", "stress", "turbofan", "nocrankshaft"] 85 VARIANTS = ["default", "stress", "turbofan", "nocrankshaft"]
88 86
89 MODE_FLAGS = { 87 DEBUG_FLAGS = ["--nohard-abort", "--nodead-code-elimination",
90 "debug" : ["--nohard-abort", "--nodead-code-elimination", 88 "--nofold-constants", "--enable-slow-asserts",
91 "--nofold-constants", "--enable-slow-asserts", 89 "--debug-code", "--verify-heap"]
92 "--debug-code", "--verify-heap"], 90 RELEASE_FLAGS = ["--nohard-abort", "--nodead-code-elimination",
93 "release" : ["--nohard-abort", "--nodead-code-elimination", 91 "--nofold-constants"]
94 "--nofold-constants"]} 92
93 MODES = {
94 "debug": {
95 "flags": DEBUG_FLAGS,
96 "timeout_scalefactor": 4,
97 "status_mode": "debug",
98 "execution_mode": "debug",
99 "output_folder": "debug",
100 },
101 "optdebug": {
102 "flags": DEBUG_FLAGS,
103 "timeout_scalefactor": 4,
104 "status_mode": "debug",
105 "execution_mode": "debug",
106 "output_folder": "optdebug",
107 },
108 "release": {
109 "flags": RELEASE_FLAGS,
110 "timeout_scalefactor": 1,
111 "status_mode": "release",
112 "execution_mode": "release",
113 "output_folder": "release",
114 },
115 # This mode requires v8 to be compiled with dchecks and slow dchecks.
116 "tryrelease": {
117 "flags": RELEASE_FLAGS + ["--enable-slow-asserts"],
118 "timeout_scalefactor": 2,
119 "status_mode": "debug",
Michael Achenbach 2015/01/28 14:10:05 Use debug as status mode as release with slow asse
120 "execution_mode": "release",
121 "output_folder": "release",
122 },
123 }
95 124
96 GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction", 125 GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction",
97 "--concurrent-recompilation-queue-length=64", 126 "--concurrent-recompilation-queue-length=64",
98 "--concurrent-recompilation-delay=500", 127 "--concurrent-recompilation-delay=500",
99 "--concurrent-recompilation"] 128 "--concurrent-recompilation"]
100 129
101 SUPPORTED_ARCHS = ["android_arm", 130 SUPPORTED_ARCHS = ["android_arm",
102 "android_arm64", 131 "android_arm64",
103 "android_ia32", 132 "android_ia32",
104 "arm", 133 "arm",
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 global VARIANTS 299 global VARIANTS
271 300
272 # Architecture and mode related stuff. 301 # Architecture and mode related stuff.
273 if options.arch_and_mode: 302 if options.arch_and_mode:
274 options.arch_and_mode = [arch_and_mode.split(".") 303 options.arch_and_mode = [arch_and_mode.split(".")
275 for arch_and_mode in options.arch_and_mode.split(",")] 304 for arch_and_mode in options.arch_and_mode.split(",")]
276 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) 305 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode])
277 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) 306 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode])
278 options.mode = options.mode.split(",") 307 options.mode = options.mode.split(",")
279 for mode in options.mode: 308 for mode in options.mode:
280 if not mode.lower() in ["debug", "release", "optdebug"]: 309 if not mode.lower() in MODES:
281 print "Unknown mode %s" % mode 310 print "Unknown mode %s" % mode
282 return False 311 return False
283 if options.arch in ["auto", "native"]: 312 if options.arch in ["auto", "native"]:
284 options.arch = ARCH_GUESS 313 options.arch = ARCH_GUESS
285 options.arch = options.arch.split(",") 314 options.arch = options.arch.split(",")
286 for arch in options.arch: 315 for arch in options.arch:
287 if not arch in SUPPORTED_ARCHS: 316 if not arch in SUPPORTED_ARCHS:
288 print "Unknown architecture %s" % arch 317 print "Unknown architecture %s" % arch
289 return False 318 return False
290 319
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 exit_code = exit_code or code 481 exit_code = exit_code or code
453 return exit_code 482 return exit_code
454 483
455 484
456 def Execute(arch, mode, args, options, suites, workspace): 485 def Execute(arch, mode, args, options, suites, workspace):
457 print(">>> Running tests for %s.%s" % (arch, mode)) 486 print(">>> Running tests for %s.%s" % (arch, mode))
458 487
459 shell_dir = options.shell_dir 488 shell_dir = options.shell_dir
460 if not shell_dir: 489 if not shell_dir:
461 if options.buildbot: 490 if options.buildbot:
491 # TODO(machenbach): Get rid of different output folder location on
492 # buildbot. Currently this is capitalized Release and Debug.
462 shell_dir = os.path.join(workspace, options.outdir, mode) 493 shell_dir = os.path.join(workspace, options.outdir, mode)
463 mode = mode.lower() 494 mode = mode.lower()
464 else: 495 else:
465 shell_dir = os.path.join(workspace, options.outdir, 496 shell_dir = os.path.join(
466 "%s.%s" % (arch, mode)) 497 workspace,
498 options.outdir,
499 "%s.%s" % (arch, MODES[mode]["output_folder"]),
500 )
467 shell_dir = os.path.relpath(shell_dir) 501 shell_dir = os.path.relpath(shell_dir)
468 502
469 if mode == "optdebug":
470 mode = "debug" # "optdebug" is just an alias.
471
472 # Populate context object. 503 # Populate context object.
473 mode_flags = MODE_FLAGS[mode] 504 mode_flags = MODES[mode]["flags"]
474 timeout = options.timeout 505 timeout = options.timeout
475 if timeout == -1: 506 if timeout == -1:
476 # Simulators are slow, therefore allow a longer default timeout. 507 # Simulators are slow, therefore allow a longer default timeout.
477 if arch in SLOW_ARCHS: 508 if arch in SLOW_ARCHS:
478 timeout = 2 * TIMEOUT_DEFAULT; 509 timeout = 2 * TIMEOUT_DEFAULT;
479 else: 510 else:
480 timeout = TIMEOUT_DEFAULT; 511 timeout = TIMEOUT_DEFAULT;
481 512
482 timeout *= TIMEOUT_SCALEFACTOR[mode] 513 timeout *= MODES[mode]["timeout_scalefactor"]
483 514
484 if options.predictable: 515 if options.predictable:
485 # Predictable mode is slower. 516 # Predictable mode is slower.
486 timeout *= 2 517 timeout *= 2
487 518
488 ctx = context.Context(arch, mode, shell_dir, 519 ctx = context.Context(arch, MODES[mode]["execution_mode"], shell_dir,
489 mode_flags, options.verbose, 520 mode_flags, options.verbose,
490 timeout, options.isolates, 521 timeout, options.isolates,
491 options.command_prefix, 522 options.command_prefix,
492 options.extra_flags, 523 options.extra_flags,
493 options.no_i18n, 524 options.no_i18n,
494 options.random_seed, 525 options.random_seed,
495 options.no_sorting, 526 options.no_sorting,
496 options.rerun_failures_count, 527 options.rerun_failures_count,
497 options.rerun_failures_max, 528 options.rerun_failures_max,
498 options.predictable, 529 options.predictable,
499 options.no_harness) 530 options.no_harness)
500 531
501 # TODO(all): Combine "simulator" and "simulator_run". 532 # TODO(all): Combine "simulator" and "simulator_run".
502 simulator_run = not options.dont_skip_simulator_slow_tests and \ 533 simulator_run = not options.dont_skip_simulator_slow_tests and \
503 arch in ['arm64', 'arm', 'mipsel', 'mips', 'mips64el'] and \ 534 arch in ['arm64', 'arm', 'mipsel', 'mips', 'mips64el'] and \
504 ARCH_GUESS and arch != ARCH_GUESS 535 ARCH_GUESS and arch != ARCH_GUESS
505 # Find available test suites and read test cases from them. 536 # Find available test suites and read test cases from them.
506 variables = { 537 variables = {
507 "arch": arch, 538 "arch": arch,
508 "asan": options.asan, 539 "asan": options.asan,
509 "deopt_fuzzer": False, 540 "deopt_fuzzer": False,
510 "gc_stress": options.gc_stress, 541 "gc_stress": options.gc_stress,
511 "isolates": options.isolates, 542 "isolates": options.isolates,
512 "mode": mode, 543 "mode": MODES[mode]["status_mode"],
513 "no_i18n": options.no_i18n, 544 "no_i18n": options.no_i18n,
514 "no_snap": options.no_snap, 545 "no_snap": options.no_snap,
515 "simulator_run": simulator_run, 546 "simulator_run": simulator_run,
516 "simulator": utils.UseSimulator(arch), 547 "simulator": utils.UseSimulator(arch),
517 "system": utils.GuessOS(), 548 "system": utils.GuessOS(),
518 "tsan": options.tsan, 549 "tsan": options.tsan,
519 "msan": options.msan, 550 "msan": options.msan,
520 "dcheck_always_on": options.dcheck_always_on, 551 "dcheck_always_on": options.dcheck_always_on,
521 } 552 }
522 all_tests = [] 553 all_tests = []
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 return 0 585 return 0
555 586
556 # Run the tests, either locally or distributed on the network. 587 # Run the tests, either locally or distributed on the network.
557 start_time = time.time() 588 start_time = time.time()
558 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() 589 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
559 if options.junitout: 590 if options.junitout:
560 progress_indicator = progress.JUnitTestProgressIndicator( 591 progress_indicator = progress.JUnitTestProgressIndicator(
561 progress_indicator, options.junitout, options.junittestsuite) 592 progress_indicator, options.junitout, options.junittestsuite)
562 if options.json_test_results: 593 if options.json_test_results:
563 progress_indicator = progress.JsonTestProgressIndicator( 594 progress_indicator = progress.JsonTestProgressIndicator(
564 progress_indicator, options.json_test_results, arch, mode) 595 progress_indicator, options.json_test_results, arch,
596 MODES[mode]["execution_mode"])
565 597
566 run_networked = not options.no_network 598 run_networked = not options.no_network
567 if not run_networked: 599 if not run_networked:
568 print("Network distribution disabled, running tests locally.") 600 print("Network distribution disabled, running tests locally.")
569 elif utils.GuessOS() != "linux": 601 elif utils.GuessOS() != "linux":
570 print("Network distribution is only supported on Linux, sorry!") 602 print("Network distribution is only supported on Linux, sorry!")
571 run_networked = False 603 run_networked = False
572 peers = [] 604 peers = []
573 if run_networked: 605 if run_networked:
574 peers = network_execution.GetPeers() 606 peers = network_execution.GetPeers()
(...skipping 16 matching lines...) Expand all
591 exit_code = runner.Run(options.j) 623 exit_code = runner.Run(options.j)
592 overall_duration = time.time() - start_time 624 overall_duration = time.time() - start_time
593 625
594 if options.time: 626 if options.time:
595 verbose.PrintTestDurations(suites, overall_duration) 627 verbose.PrintTestDurations(suites, overall_duration)
596 return exit_code 628 return exit_code
597 629
598 630
599 if __name__ == "__main__": 631 if __name__ == "__main__":
600 sys.exit(Main()) 632 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698