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

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

Issue 1283513003: Make run-tests.py warn when it's not testing anything (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 for (arch, mode) in options.arch_and_mode: 525 for (arch, mode) in options.arch_and_mode:
526 try: 526 try:
527 code = Execute(arch, mode, args, options, suites, workspace) 527 code = Execute(arch, mode, args, options, suites, workspace)
528 except KeyboardInterrupt: 528 except KeyboardInterrupt:
529 return 2 529 return 2
530 exit_code = exit_code or code 530 exit_code = exit_code or code
531 return exit_code 531 return exit_code
532 532
533 533
534 def Execute(arch, mode, args, options, suites, workspace): 534 def Execute(arch, mode, args, options, suites, workspace):
535 print(">>> Running tests for %s.%s" % (arch, mode))
536
537 shell_dir = options.shell_dir 535 shell_dir = options.shell_dir
538 if not shell_dir: 536 if not shell_dir:
539 if options.buildbot: 537 if options.buildbot:
540 # TODO(machenbach): Get rid of different output folder location on 538 # TODO(machenbach): Get rid of different output folder location on
541 # buildbot. Currently this is capitalized Release and Debug. 539 # buildbot. Currently this is capitalized Release and Debug.
542 shell_dir = os.path.join(workspace, options.outdir, mode) 540 shell_dir = os.path.join(workspace, options.outdir, mode)
543 mode = BuildbotToV8Mode(mode) 541 mode = BuildbotToV8Mode(mode)
544 else: 542 else:
545 shell_dir = os.path.join( 543 shell_dir = os.path.join(
546 workspace, 544 workspace,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 ] 642 ]
645 else: 643 else:
646 s.tests = variant_tests 644 s.tests = variant_tests
647 645
648 s.tests = ShardTests(s.tests, options.shard_count, options.shard_run) 646 s.tests = ShardTests(s.tests, options.shard_count, options.shard_run)
649 num_tests += len(s.tests) 647 num_tests += len(s.tests)
650 648
651 if options.cat: 649 if options.cat:
652 return 0 # We're done here. 650 return 0 # We're done here.
653 651
652 if num_tests == 0:
653 print("No tests selected for running!")
654 if len(all_tests) > 0:
655 verbose.PrintReport(all_tests)
656 return 0
657
658 print(">>> Running tests for %s.%s" % (arch, mode))
659
654 if options.report: 660 if options.report:
655 verbose.PrintReport(all_tests) 661 verbose.PrintReport(all_tests)
656 662
657 # Run the tests, either locally or distributed on the network. 663 # Run the tests, either locally or distributed on the network.
658 start_time = time.time() 664 start_time = time.time()
659 progress_indicator = progress.IndicatorNotifier() 665 progress_indicator = progress.IndicatorNotifier()
660 progress_indicator.Register(progress.PROGRESS_INDICATORS[options.progress]()) 666 progress_indicator.Register(progress.PROGRESS_INDICATORS[options.progress]())
661 if options.junitout: 667 if options.junitout:
662 progress_indicator.Register(progress.JUnitTestProgressIndicator( 668 progress_indicator.Register(progress.JUnitTestProgressIndicator(
663 options.junitout, options.junittestsuite)) 669 options.junitout, options.junittestsuite))
(...skipping 30 matching lines...) Expand all
694 exit_code = runner.Run(options.j) 700 exit_code = runner.Run(options.j)
695 overall_duration = time.time() - start_time 701 overall_duration = time.time() - start_time
696 702
697 if options.time: 703 if options.time:
698 verbose.PrintTestDurations(suites, overall_duration) 704 verbose.PrintTestDurations(suites, overall_duration)
699 return exit_code 705 return exit_code
700 706
701 707
702 if __name__ == "__main__": 708 if __name__ == "__main__":
703 sys.exit(Main()) 709 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