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

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

Issue 1276853002: [test] Return variant and random seed on failures. (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 | « tools/run-deopt-fuzzer.py ('k') | tools/testrunner/local/progress.py » ('j') | 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 s.ReadTestCases(ctx) 615 s.ReadTestCases(ctx)
616 if len(args) > 0: 616 if len(args) > 0:
617 s.FilterTestCasesByArgs(args) 617 s.FilterTestCasesByArgs(args)
618 all_tests += s.tests 618 all_tests += s.tests
619 s.FilterTestCasesByStatus(options.warn_unused, options.flaky_tests, 619 s.FilterTestCasesByStatus(options.warn_unused, options.flaky_tests,
620 options.slow_tests, options.pass_fail_tests) 620 options.slow_tests, options.pass_fail_tests)
621 if options.cat: 621 if options.cat:
622 verbose.PrintTestSource(s.tests) 622 verbose.PrintTestSource(s.tests)
623 continue 623 continue
624 variant_gen = s.CreateVariantGenerator(VARIANTS) 624 variant_gen = s.CreateVariantGenerator(VARIANTS)
625 variant_tests = [ t.CopyAddingFlags(flags) 625 variant_tests = [ t.CopyAddingFlags(v, flags)
626 for t in s.tests 626 for t in s.tests
627 for v in variant_gen.FilterVariantsByTest(t) 627 for v in variant_gen.FilterVariantsByTest(t)
628 for flags in variant_gen.GetFlagSets(t, v) ] 628 for flags in variant_gen.GetFlagSets(t, v) ]
629 629
630 if options.random_seed_stress_count > 1: 630 if options.random_seed_stress_count > 1:
631 # Duplicate test for random seed stress mode. 631 # Duplicate test for random seed stress mode.
632 def iter_seed_flags(): 632 def iter_seed_flags():
633 for i in range(0, options.random_seed_stress_count): 633 for i in range(0, options.random_seed_stress_count):
634 # Use given random seed for all runs (set by default in execution.py) 634 # Use given random seed for all runs (set by default in execution.py)
635 # or a new random seed if none is specified. 635 # or a new random seed if none is specified.
636 if options.random_seed: 636 if options.random_seed:
637 yield [] 637 yield []
638 else: 638 else:
639 yield ["--random-seed=%d" % RandomSeed()] 639 yield ["--random-seed=%d" % RandomSeed()]
640 s.tests = [ 640 s.tests = [
641 t.CopyAddingFlags(flags) 641 t.CopyAddingFlags(t.variant, flags)
642 for t in variant_tests 642 for t in variant_tests
643 for flags in iter_seed_flags() 643 for flags in iter_seed_flags()
644 ] 644 ]
645 else: 645 else:
646 s.tests = variant_tests 646 s.tests = variant_tests
647 647
648 s.tests = ShardTests(s.tests, options.shard_count, options.shard_run) 648 s.tests = ShardTests(s.tests, options.shard_count, options.shard_run)
649 num_tests += len(s.tests) 649 num_tests += len(s.tests)
650 650
651 if options.cat: 651 if options.cat:
652 return 0 # We're done here. 652 return 0 # We're done here.
653 653
654 if options.report: 654 if options.report:
655 verbose.PrintReport(all_tests) 655 verbose.PrintReport(all_tests)
656 656
657 # Run the tests, either locally or distributed on the network. 657 # Run the tests, either locally or distributed on the network.
658 start_time = time.time() 658 start_time = time.time()
659 progress_indicator = progress.IndicatorNotifier() 659 progress_indicator = progress.IndicatorNotifier()
660 progress_indicator.Register(progress.PROGRESS_INDICATORS[options.progress]()) 660 progress_indicator.Register(progress.PROGRESS_INDICATORS[options.progress]())
661 if options.junitout: 661 if options.junitout:
662 progress_indicator.Register(progress.JUnitTestProgressIndicator( 662 progress_indicator.Register(progress.JUnitTestProgressIndicator(
663 options.junitout, options.junittestsuite)) 663 options.junitout, options.junittestsuite))
664 if options.json_test_results: 664 if options.json_test_results:
665 progress_indicator.Register(progress.JsonTestProgressIndicator( 665 progress_indicator.Register(progress.JsonTestProgressIndicator(
666 options.json_test_results, arch, MODES[mode]["execution_mode"])) 666 options.json_test_results, arch, MODES[mode]["execution_mode"],
667 ctx.random_seed))
667 668
668 run_networked = not options.no_network 669 run_networked = not options.no_network
669 if not run_networked: 670 if not run_networked:
670 print("Network distribution disabled, running tests locally.") 671 print("Network distribution disabled, running tests locally.")
671 elif utils.GuessOS() != "linux": 672 elif utils.GuessOS() != "linux":
672 print("Network distribution is only supported on Linux, sorry!") 673 print("Network distribution is only supported on Linux, sorry!")
673 run_networked = False 674 run_networked = False
674 peers = [] 675 peers = []
675 if run_networked: 676 if run_networked:
676 peers = network_execution.GetPeers() 677 peers = network_execution.GetPeers()
(...skipping 16 matching lines...) Expand all
693 exit_code = runner.Run(options.j) 694 exit_code = runner.Run(options.j)
694 overall_duration = time.time() - start_time 695 overall_duration = time.time() - start_time
695 696
696 if options.time: 697 if options.time:
697 verbose.PrintTestDurations(suites, overall_duration) 698 verbose.PrintTestDurations(suites, overall_duration)
698 return exit_code 699 return exit_code
699 700
700 701
701 if __name__ == "__main__": 702 if __name__ == "__main__":
702 sys.exit(Main()) 703 sys.exit(Main())
OLDNEW
« no previous file with comments | « tools/run-deopt-fuzzer.py ('k') | tools/testrunner/local/progress.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698