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

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

Issue 2196223002: [test] Add testing variant aliases. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review Created 4 years, 4 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ], 107 ],
108 "unittests": [ 108 "unittests": [
109 "unittests", 109 "unittests",
110 ], 110 ],
111 } 111 }
112 112
113 TIMEOUT_DEFAULT = 60 113 TIMEOUT_DEFAULT = 60
114 114
115 VARIANTS = ["default", "stress", "turbofan"] 115 VARIANTS = ["default", "stress", "turbofan"]
116 116
117 EXHAUSTIVE_VARIANTS = VARIANTS + [ 117 MORE_VARIANTS = [
118 "ignition", 118 "ignition",
119 "nocrankshaft", 119 "nocrankshaft",
120 "turbofan_opt", 120 "turbofan_opt",
121 ] 121 ]
122 122
123 EXHAUSTIVE_VARIANTS = VARIANTS + MORE_VARIANTS
124
125 VARIANT_ALIASES = {
126 # The default for developer workstations.
127 "dev": VARIANTS,
128 # Additional variants, run on all bots.
129 "more": MORE_VARIANTS,
130 # Additional variants, run on a subset of bots.
131 "extra": [],
132 }
133
123 DEBUG_FLAGS = ["--nohard-abort", "--nodead-code-elimination", 134 DEBUG_FLAGS = ["--nohard-abort", "--nodead-code-elimination",
124 "--nofold-constants", "--enable-slow-asserts", 135 "--nofold-constants", "--enable-slow-asserts",
125 "--debug-code", "--verify-heap"] 136 "--debug-code", "--verify-heap"]
126 RELEASE_FLAGS = ["--nohard-abort", "--nodead-code-elimination", 137 RELEASE_FLAGS = ["--nohard-abort", "--nodead-code-elimination",
127 "--nofold-constants"] 138 "--nofold-constants"]
128 139
129 MODES = { 140 MODES = {
130 "debug": { 141 "debug": {
131 "flags": DEBUG_FLAGS, 142 "flags": DEBUG_FLAGS,
132 "timeout_scalefactor": 4, 143 "timeout_scalefactor": 4,
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 os.environ['TSAN_OPTIONS'] = " ".join([ 442 os.environ['TSAN_OPTIONS'] = " ".join([
432 symbolizer, 443 symbolizer,
433 'suppressions=%s' % suppressions_file, 444 'suppressions=%s' % suppressions_file,
434 'exit_code=0', 445 'exit_code=0',
435 'report_thread_leaks=0', 446 'report_thread_leaks=0',
436 'history_size=7', 447 'history_size=7',
437 'report_destroy_locked=0', 448 'report_destroy_locked=0',
438 ]) 449 ])
439 450
440 def ProcessOptions(options): 451 def ProcessOptions(options):
441 global ALL_VARIANTS
442 global EXHAUSTIVE_VARIANTS
443 global VARIANTS 452 global VARIANTS
444 453
445 # First try to auto-detect configurations based on the build if GN was 454 # First try to auto-detect configurations based on the build if GN was
446 # used. This can't be overridden by cmd-line arguments. 455 # used. This can't be overridden by cmd-line arguments.
447 options.auto_detect = False 456 options.auto_detect = False
448 build_config_path = os.path.join( 457 build_config_path = os.path.join(
449 BASE_DIR, options.outdir, "v8_build_config.json") 458 BASE_DIR, options.outdir, "v8_build_config.json")
450 if os.path.exists(build_config_path): 459 if os.path.exists(build_config_path):
451 try: 460 try:
452 with open(build_config_path) as f: 461 with open(build_config_path) as f:
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 options.extra_flags.append("--omit-quit") 522 options.extra_flags.append("--omit-quit")
514 523
515 if options.novfp3: 524 if options.novfp3:
516 options.extra_flags.append("--noenable-vfp3") 525 options.extra_flags.append("--noenable-vfp3")
517 526
518 if options.exhaustive_variants: 527 if options.exhaustive_variants:
519 # This is used on many bots. It includes a larger set of default variants. 528 # This is used on many bots. It includes a larger set of default variants.
520 # Other options for manipulating variants still apply afterwards. 529 # Other options for manipulating variants still apply afterwards.
521 VARIANTS = EXHAUSTIVE_VARIANTS 530 VARIANTS = EXHAUSTIVE_VARIANTS
522 531
532 # TODO(machenbach): Figure out how to test a bigger subset of variants on
533 # msan and tsan.
523 if options.msan: 534 if options.msan:
524 VARIANTS = ["default"] 535 VARIANTS = ["default"]
525 536
526 if options.tsan: 537 if options.tsan:
527 VARIANTS = ["default"] 538 VARIANTS = ["default"]
528 539
529 if options.j == 0: 540 if options.j == 0:
530 options.j = multiprocessing.cpu_count() 541 options.j = multiprocessing.cpu_count()
531 542
532 if options.random_seed_stress_count <= 1 and options.random_seed == 0: 543 if options.random_seed_stress_count <= 1 and options.random_seed == 0:
533 options.random_seed = RandomSeed() 544 options.random_seed = RandomSeed()
534 545
535 def excl(*args): 546 def excl(*args):
536 """Returns true if zero or one of multiple arguments are true.""" 547 """Returns true if zero or one of multiple arguments are true."""
537 return reduce(lambda x, y: x + y, args) <= 1 548 return reduce(lambda x, y: x + y, args) <= 1
538 549
539 if not excl(options.no_stress, options.stress_only, options.no_variants, 550 if not excl(options.no_stress, options.stress_only, options.no_variants,
540 bool(options.variants)): 551 bool(options.variants)):
541 print("Use only one of --no-stress, --stress-only, --no-variants, " 552 print("Use only one of --no-stress, --stress-only, --no-variants, "
542 "or --variants.") 553 "or --variants.")
543 return False 554 return False
544 if options.quickcheck: 555 if options.quickcheck:
545 VARIANTS = ["default", "stress"] 556 VARIANTS = ["default", "stress"]
546 options.slow_tests = "skip" 557 options.slow_tests = "skip"
547 options.pass_fail_tests = "skip" 558 options.pass_fail_tests = "skip"
548 if options.no_stress: 559 if options.no_stress:
560 # FIXME(machenbach): This is not very intuitive anymore. Maybe remove a
561 # bunch of these shortcuts and require stating the variants explicitly.
549 VARIANTS = ["default", "nocrankshaft"] 562 VARIANTS = ["default", "nocrankshaft"]
550 if options.no_variants: 563 if options.no_variants:
551 VARIANTS = ["default"] 564 VARIANTS = ["default"]
552 if options.stress_only: 565 if options.stress_only:
553 VARIANTS = ["stress"] 566 VARIANTS = ["stress"]
554 if options.variants: 567 if options.variants:
555 VARIANTS = options.variants.split(",") 568 VARIANTS = options.variants.split(",")
569
570 # Resolve variant aliases.
571 VARIANTS = reduce(
572 list.__add__,
573 (VARIANT_ALIASES.get(v, [v]) for v in VARIANTS),
574 [],
575 )
576
556 if not set(VARIANTS).issubset(ALL_VARIANTS): 577 if not set(VARIANTS).issubset(ALL_VARIANTS):
557 print "All variants must be in %s" % str(ALL_VARIANTS) 578 print "All variants must be in %s" % str(ALL_VARIANTS)
558 return False 579 return False
559 if options.predictable: 580 if options.predictable:
560 VARIANTS = ["default"] 581 VARIANTS = ["default"]
561 options.extra_flags.append("--predictable") 582 options.extra_flags.append("--predictable")
562 options.extra_flags.append("--verify_predictable") 583 options.extra_flags.append("--verify_predictable")
563 options.extra_flags.append("--no-inline-new") 584 options.extra_flags.append("--no-inline-new")
564 585
586 # Dedupe.
587 VARIANTS = list(set(VARIANTS))
588
565 if not options.shell_dir: 589 if not options.shell_dir:
566 if options.shell: 590 if options.shell:
567 print "Warning: --shell is deprecated, use --shell-dir instead." 591 print "Warning: --shell is deprecated, use --shell-dir instead."
568 options.shell_dir = os.path.dirname(options.shell) 592 options.shell_dir = os.path.dirname(options.shell)
569 if options.valgrind: 593 if options.valgrind:
570 run_valgrind = os.path.join("tools", "run-valgrind.py") 594 run_valgrind = os.path.join("tools", "run-valgrind.py")
571 # This is OK for distributed running, so we don't need to set no_network. 595 # This is OK for distributed running, so we don't need to set no_network.
572 options.command_prefix = (["python", "-u", run_valgrind] + 596 options.command_prefix = (["python", "-u", run_valgrind] +
573 options.command_prefix) 597 options.command_prefix)
574 def CheckTestMode(name, option): 598 def CheckTestMode(name, option):
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 "--coverage-dir=%s" % options.sancov_dir]) 905 "--coverage-dir=%s" % options.sancov_dir])
882 except: 906 except:
883 print >> sys.stderr, "Error: Merging sancov files failed." 907 print >> sys.stderr, "Error: Merging sancov files failed."
884 exit_code = 1 908 exit_code = 1
885 909
886 return exit_code 910 return exit_code
887 911
888 912
889 if __name__ == "__main__": 913 if __name__ == "__main__":
890 sys.exit(Main()) 914 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