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

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

Issue 2431653002: [test] Correctly deduce test-driver arguments on bots using GN (Closed)
Patch Set: fixes Created 4 years, 2 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 gn_config_dir = os.path.join(gn_out_dir, gn_config) 445 gn_config_dir = os.path.join(gn_out_dir, gn_config)
446 if not isdir(gn_config_dir): 446 if not isdir(gn_config_dir):
447 continue 447 continue
448 if os.path.getmtime(gn_config_dir) > latest_timestamp: 448 if os.path.getmtime(gn_config_dir) > latest_timestamp:
449 latest_timestamp = os.path.getmtime(gn_config_dir) 449 latest_timestamp = os.path.getmtime(gn_config_dir)
450 latest_config = gn_config 450 latest_config = gn_config
451 if latest_config: 451 if latest_config:
452 print(">>> Latest GN build found is %s" % latest_config) 452 print(">>> Latest GN build found is %s" % latest_config)
453 options.outdir = os.path.join(DEFAULT_OUT_GN, latest_config) 453 options.outdir = os.path.join(DEFAULT_OUT_GN, latest_config)
454 454
455 build_config_path = os.path.join( 455 if options.buildbot:
456 BASE_DIR, options.outdir, "v8_build_config.json") 456 build_config_path = os.path.join(
457 BASE_DIR, options.outdir, options.mode, "v8_build_config.json")
Michael Achenbach 2016/10/18 14:05:37 It is a convention on buildbot that the build prod
458 else:
459 build_config_path = os.path.join(
460 BASE_DIR, options.outdir, "v8_build_config.json")
461
457 if os.path.exists(build_config_path): 462 if os.path.exists(build_config_path):
458 try: 463 try:
459 with open(build_config_path) as f: 464 with open(build_config_path) as f:
460 build_config = json.load(f) 465 build_config = json.load(f)
461 except Exception: 466 except Exception:
462 print ("%s exists but contains invalid json. Is your build up-to-date?" % 467 print ("%s exists but contains invalid json. Is your build up-to-date?" %
463 build_config_path) 468 build_config_path)
464 return False 469 return False
465 options.auto_detect = True 470 options.auto_detect = True
466 471
472 # In auto-detect mode the outdir is always where we found the build config.
473 # This ensures that we'll also take the build products from there.
474 options.outdir = os.path.dirname(build_config_path)
475
467 options.arch_and_mode = None 476 options.arch_and_mode = None
468 options.arch = build_config["v8_target_cpu"] 477 options.arch = build_config["v8_target_cpu"]
469 if options.arch == 'x86': 478 if options.arch == 'x86':
470 # TODO(machenbach): Transform all to x86 eventually. 479 # TODO(machenbach): Transform all to x86 eventually.
471 options.arch = 'ia32' 480 options.arch = 'ia32'
472 options.asan = build_config["is_asan"] 481 options.asan = build_config["is_asan"]
473 options.dcheck_always_on = build_config["dcheck_always_on"] 482 options.dcheck_always_on = build_config["dcheck_always_on"]
474 options.enable_inspector = build_config["v8_enable_inspector"] 483 options.enable_inspector = build_config["v8_enable_inspector"]
475 options.mode = 'debug' if build_config["is_debug"] else 'release' 484 options.mode = 'debug' if build_config["is_debug"] else 'release'
476 options.msan = build_config["is_msan"] 485 options.msan = build_config["is_msan"]
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 return 2 713 return 2
705 exit_code = exit_code or code 714 exit_code = exit_code or code
706 return exit_code 715 return exit_code
707 716
708 717
709 def Execute(arch, mode, args, options, suites): 718 def Execute(arch, mode, args, options, suites):
710 print(">>> Running tests for %s.%s" % (arch, mode)) 719 print(">>> Running tests for %s.%s" % (arch, mode))
711 720
712 shell_dir = options.shell_dir 721 shell_dir = options.shell_dir
713 if not shell_dir: 722 if not shell_dir:
714 if options.buildbot: 723 if options.auto_detect:
724 # If an output dir with a build was passed, test directly in that
725 # directory.
726 shell_dir = os.path.join(BASE_DIR, options.outdir)
727 elif options.buildbot:
Michael Achenbach 2016/10/18 14:05:37 This remains for gyp bots that don't support auto-
715 # TODO(machenbach): Get rid of different output folder location on 728 # TODO(machenbach): Get rid of different output folder location on
716 # buildbot. Currently this is capitalized Release and Debug. 729 # buildbot. Currently this is capitalized Release and Debug.
717 shell_dir = os.path.join(BASE_DIR, options.outdir, mode) 730 shell_dir = os.path.join(BASE_DIR, options.outdir, mode)
718 mode = BuildbotToV8Mode(mode) 731 mode = BuildbotToV8Mode(mode)
719 elif options.auto_detect:
720 # If an output dir with a build was passed, test directly in that
721 # directory.
722 shell_dir = os.path.join(BASE_DIR, options.outdir)
723 else: 732 else:
724 shell_dir = os.path.join( 733 shell_dir = os.path.join(
725 BASE_DIR, 734 BASE_DIR,
726 options.outdir, 735 options.outdir,
727 "%s.%s" % (arch, MODES[mode]["output_folder"]), 736 "%s.%s" % (arch, MODES[mode]["output_folder"]),
728 ) 737 )
729 if not os.path.exists(shell_dir): 738 if not os.path.exists(shell_dir):
730 raise Exception('Could not find shell_dir: "%s"' % shell_dir) 739 raise Exception('Could not find shell_dir: "%s"' % shell_dir)
731 740
732 # Populate context object. 741 # Populate context object.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 "--coverage-dir=%s" % options.sancov_dir]) 917 "--coverage-dir=%s" % options.sancov_dir])
909 except: 918 except:
910 print >> sys.stderr, "Error: Merging sancov files failed." 919 print >> sys.stderr, "Error: Merging sancov files failed."
911 exit_code = 1 920 exit_code = 1
912 921
913 return exit_code 922 return exit_code
914 923
915 924
916 if __name__ == "__main__": 925 if __name__ == "__main__":
917 sys.exit(Main()) 926 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