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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 os.path.join(workspace, "test", root)) | 312 os.path.join(workspace, "test", root)) |
313 if suite: | 313 if suite: |
314 suites.append(suite) | 314 suites.append(suite) |
315 | 315 |
316 if options.download_data: | 316 if options.download_data: |
317 for s in suites: | 317 for s in suites: |
318 s.DownloadData() | 318 s.DownloadData() |
319 | 319 |
320 for mode in options.mode: | 320 for mode in options.mode: |
321 for arch in options.arch: | 321 for arch in options.arch: |
322 code = Execute(arch, mode, args, options, suites, workspace) | 322 try: |
323 exit_code = exit_code or code | 323 code = Execute(arch, mode, args, options, suites, workspace) |
| 324 exit_code = exit_code or code |
| 325 except KeyboardInterrupt: |
| 326 return 2 |
324 return exit_code | 327 return exit_code |
325 | 328 |
326 | 329 |
327 def CalculateNTests(m, options): | 330 def CalculateNTests(m, options): |
328 """Calculates the number of tests from m deopt points with exponential | 331 """Calculates the number of tests from m deopt points with exponential |
329 coverage. | 332 coverage. |
330 The coverage is expected to be between 0.0 and 1.0. | 333 The coverage is expected to be between 0.0 and 1.0. |
331 The 'coverage lift' lifts the coverage for tests with smaller m values. | 334 The 'coverage lift' lifts the coverage for tests with smaller m values. |
332 """ | 335 """ |
333 c = float(options.coverage) | 336 c = float(options.coverage) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 s.tests = [ t.CopyAddingFlags(analysis_flags) for t in s.tests ] | 405 s.tests = [ t.CopyAddingFlags(analysis_flags) for t in s.tests ] |
403 num_tests += len(s.tests) | 406 num_tests += len(s.tests) |
404 for t in s.tests: | 407 for t in s.tests: |
405 t.id = test_id | 408 t.id = test_id |
406 test_id += 1 | 409 test_id += 1 |
407 | 410 |
408 if num_tests == 0: | 411 if num_tests == 0: |
409 print "No tests to run." | 412 print "No tests to run." |
410 return 0 | 413 return 0 |
411 | 414 |
412 try: | 415 print(">>> Collection phase") |
413 print(">>> Collection phase") | 416 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() |
414 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() | 417 runner = execution.Runner(suites, progress_indicator, ctx) |
415 runner = execution.Runner(suites, progress_indicator, ctx) | |
416 | 418 |
417 exit_code = runner.Run(options.j) | 419 exit_code = runner.Run(options.j) |
418 if runner.terminate: | |
419 return exit_code | |
420 | |
421 except KeyboardInterrupt: | |
422 return 1 | |
423 | 420 |
424 print(">>> Analysis phase") | 421 print(">>> Analysis phase") |
425 num_tests = 0 | 422 num_tests = 0 |
426 test_id = 0 | 423 test_id = 0 |
427 for s in suites: | 424 for s in suites: |
428 test_results = {} | 425 test_results = {} |
429 for t in s.tests: | 426 for t in s.tests: |
430 for line in t.output.stdout.splitlines(): | 427 for line in t.output.stdout.splitlines(): |
431 if line.startswith("=== Stress deopt counter: "): | 428 if line.startswith("=== Stress deopt counter: "): |
432 test_results[t.path] = MAX_DEOPT - int(line.split(" ")[-1]) | 429 test_results[t.path] = MAX_DEOPT - int(line.split(" ")[-1]) |
(...skipping 22 matching lines...) Expand all Loading... |
455 s.tests.append(t.CopyAddingFlags(fuzzing_flags)) | 452 s.tests.append(t.CopyAddingFlags(fuzzing_flags)) |
456 num_tests += len(s.tests) | 453 num_tests += len(s.tests) |
457 for t in s.tests: | 454 for t in s.tests: |
458 t.id = test_id | 455 t.id = test_id |
459 test_id += 1 | 456 test_id += 1 |
460 | 457 |
461 if num_tests == 0: | 458 if num_tests == 0: |
462 print "No tests to run." | 459 print "No tests to run." |
463 return 0 | 460 return 0 |
464 | 461 |
465 try: | 462 print(">>> Deopt fuzzing phase (%d test cases)" % num_tests) |
466 print(">>> Deopt fuzzing phase (%d test cases)" % num_tests) | 463 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() |
467 progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() | 464 runner = execution.Runner(suites, progress_indicator, ctx) |
468 runner = execution.Runner(suites, progress_indicator, ctx) | |
469 | 465 |
470 exit_code = runner.Run(options.j) | 466 code = runner.Run(options.j) |
471 if runner.terminate: | 467 return exit_code or code |
472 return exit_code | |
473 | |
474 except KeyboardInterrupt: | |
475 return 1 | |
476 | |
477 return exit_code | |
478 | 468 |
479 | 469 |
480 if __name__ == "__main__": | 470 if __name__ == "__main__": |
481 sys.exit(Main()) | 471 sys.exit(Main()) |
OLD | NEW |