| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 result.add_option("--time", help="Print timing information after running", | 138 result.add_option("--time", help="Print timing information after running", |
| 139 default=False, action="store_true") | 139 default=False, action="store_true") |
| 140 result.add_option("-t", "--timeout", help="Timeout in seconds", | 140 result.add_option("-t", "--timeout", help="Timeout in seconds", |
| 141 default= -1, type="int") | 141 default= -1, type="int") |
| 142 result.add_option("-v", "--verbose", help="Verbose output", | 142 result.add_option("-v", "--verbose", help="Verbose output", |
| 143 default=False, action="store_true") | 143 default=False, action="store_true") |
| 144 result.add_option("--valgrind", help="Run tests through valgrind", | 144 result.add_option("--valgrind", help="Run tests through valgrind", |
| 145 default=False, action="store_true") | 145 default=False, action="store_true") |
| 146 result.add_option("--warn-unused", help="Report unused rules", | 146 result.add_option("--warn-unused", help="Report unused rules", |
| 147 default=False, action="store_true") | 147 default=False, action="store_true") |
| 148 result.add_option("--junitout", help="File name of the JUnit output") |
| 149 result.add_option("--junittestsuite", |
| 150 help="The testsuite name in the JUnit output file", |
| 151 default="v8tests") |
| 148 return result | 152 return result |
| 149 | 153 |
| 150 | 154 |
| 151 def ProcessOptions(options): | 155 def ProcessOptions(options): |
| 152 global VARIANT_FLAGS | 156 global VARIANT_FLAGS |
| 153 | 157 |
| 154 # Architecture and mode related stuff. | 158 # Architecture and mode related stuff. |
| 155 if options.arch_and_mode: | 159 if options.arch_and_mode: |
| 156 tokens = options.arch_and_mode.split(".") | 160 tokens = options.arch_and_mode.split(".") |
| 157 options.arch = tokens[0] | 161 options.arch = tokens[0] |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 verbose.PrintReport(all_tests) | 329 verbose.PrintReport(all_tests) |
| 326 | 330 |
| 327 if num_tests == 0: | 331 if num_tests == 0: |
| 328 print "No tests to run." | 332 print "No tests to run." |
| 329 return 0 | 333 return 0 |
| 330 | 334 |
| 331 # Run the tests, either locally or distributed on the network. | 335 # Run the tests, either locally or distributed on the network. |
| 332 try: | 336 try: |
| 333 start_time = time.time() | 337 start_time = time.time() |
| 334 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() | 338 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() |
| 339 if options.junitout: |
| 340 progress_indicator = progress.JUnitTestProgressIndicator( |
| 341 progress_indicator, options.junitout, options.junittestsuite) |
| 335 | 342 |
| 336 run_networked = not options.no_network | 343 run_networked = not options.no_network |
| 337 if not run_networked: | 344 if not run_networked: |
| 338 print("Network distribution disabled, running tests locally.") | 345 print("Network distribution disabled, running tests locally.") |
| 339 elif utils.GuessOS() != "linux": | 346 elif utils.GuessOS() != "linux": |
| 340 print("Network distribution is only supported on Linux, sorry!") | 347 print("Network distribution is only supported on Linux, sorry!") |
| 341 run_networked = False | 348 run_networked = False |
| 342 peers = [] | 349 peers = [] |
| 343 if run_networked: | 350 if run_networked: |
| 344 peers = network_execution.GetPeers() | 351 peers = network_execution.GetPeers() |
| (...skipping 20 matching lines...) Expand all Loading... |
| 365 except KeyboardInterrupt: | 372 except KeyboardInterrupt: |
| 366 return 1 | 373 return 1 |
| 367 | 374 |
| 368 if options.time: | 375 if options.time: |
| 369 verbose.PrintTestDurations(suites, overall_duration) | 376 verbose.PrintTestDurations(suites, overall_duration) |
| 370 return exit_code | 377 return exit_code |
| 371 | 378 |
| 372 | 379 |
| 373 if __name__ == "__main__": | 380 if __name__ == "__main__": |
| 374 sys.exit(Main()) | 381 sys.exit(Main()) |
| OLD | NEW |