OLD | NEW |
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 result.add_option("--outdir", help="Base directory with compile output", | 166 result.add_option("--outdir", help="Base directory with compile output", |
167 default="out") | 167 default="out") |
168 result.add_option("-p", "--progress", | 168 result.add_option("-p", "--progress", |
169 help=("The style of progress indicator" | 169 help=("The style of progress indicator" |
170 " (verbose, dots, color, mono)"), | 170 " (verbose, dots, color, mono)"), |
171 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") | 171 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") |
172 result.add_option("--quickcheck", default=False, action="store_true", | 172 result.add_option("--quickcheck", default=False, action="store_true", |
173 help=("Quick check mode (skip slow/flaky tests)")) | 173 help=("Quick check mode (skip slow/flaky tests)")) |
174 result.add_option("--report", help="Print a summary of the tests to be run", | 174 result.add_option("--report", help="Print a summary of the tests to be run", |
175 default=False, action="store_true") | 175 default=False, action="store_true") |
| 176 result.add_option("--json-test-results", |
| 177 help="Path to a file for storing json results.") |
176 result.add_option("--shard-count", | 178 result.add_option("--shard-count", |
177 help="Split testsuites into this number of shards", | 179 help="Split testsuites into this number of shards", |
178 default=1, type="int") | 180 default=1, type="int") |
179 result.add_option("--shard-run", | 181 result.add_option("--shard-run", |
180 help="Run this shard from the split up tests.", | 182 help="Run this shard from the split up tests.", |
181 default=1, type="int") | 183 default=1, type="int") |
182 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="") | 184 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="") |
183 result.add_option("--shell-dir", help="Directory containing executables", | 185 result.add_option("--shell-dir", help="Directory containing executables", |
184 default="") | 186 default="") |
185 result.add_option("--dont-skip-slow-simulator-tests", | 187 result.add_option("--dont-skip-slow-simulator-tests", |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 if num_tests == 0: | 458 if num_tests == 0: |
457 print "No tests to run." | 459 print "No tests to run." |
458 return 0 | 460 return 0 |
459 | 461 |
460 # Run the tests, either locally or distributed on the network. | 462 # Run the tests, either locally or distributed on the network. |
461 start_time = time.time() | 463 start_time = time.time() |
462 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() | 464 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() |
463 if options.junitout: | 465 if options.junitout: |
464 progress_indicator = progress.JUnitTestProgressIndicator( | 466 progress_indicator = progress.JUnitTestProgressIndicator( |
465 progress_indicator, options.junitout, options.junittestsuite) | 467 progress_indicator, options.junitout, options.junittestsuite) |
| 468 if options.json_test_results: |
| 469 progress_indicator = progress.JsonTestProgressIndicator( |
| 470 progress_indicator, options.json_test_results, arch, mode) |
466 | 471 |
467 run_networked = not options.no_network | 472 run_networked = not options.no_network |
468 if not run_networked: | 473 if not run_networked: |
469 print("Network distribution disabled, running tests locally.") | 474 print("Network distribution disabled, running tests locally.") |
470 elif utils.GuessOS() != "linux": | 475 elif utils.GuessOS() != "linux": |
471 print("Network distribution is only supported on Linux, sorry!") | 476 print("Network distribution is only supported on Linux, sorry!") |
472 run_networked = False | 477 run_networked = False |
473 peers = [] | 478 peers = [] |
474 if run_networked: | 479 if run_networked: |
475 peers = network_execution.GetPeers() | 480 peers = network_execution.GetPeers() |
(...skipping 16 matching lines...) Expand all Loading... |
492 exit_code = runner.Run(options.j) | 497 exit_code = runner.Run(options.j) |
493 overall_duration = time.time() - start_time | 498 overall_duration = time.time() - start_time |
494 | 499 |
495 if options.time: | 500 if options.time: |
496 verbose.PrintTestDurations(suites, overall_duration) | 501 verbose.PrintTestDurations(suites, overall_duration) |
497 return exit_code | 502 return exit_code |
498 | 503 |
499 | 504 |
500 if __name__ == "__main__": | 505 if __name__ == "__main__": |
501 sys.exit(Main()) | 506 sys.exit(Main()) |
OLD | NEW |