| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 results_path = self._filesystem.join(self._results_directory, "resul
ts.html") | 305 results_path = self._filesystem.join(self._results_directory, "resul
ts.html") |
| 306 self._copy_results_html_file(results_path) | 306 self._copy_results_html_file(results_path) |
| 307 if initial_results.keyboard_interrupted: | 307 if initial_results.keyboard_interrupted: |
| 308 exit_code = test_run_results.INTERRUPTED_EXIT_STATUS | 308 exit_code = test_run_results.INTERRUPTED_EXIT_STATUS |
| 309 else: | 309 else: |
| 310 if initial_results.interrupted: | 310 if initial_results.interrupted: |
| 311 exit_code = test_run_results.EARLY_EXIT_STATUS | 311 exit_code = test_run_results.EARLY_EXIT_STATUS |
| 312 if self._options.show_results and (exit_code or (self._options.f
ull_results_html and initial_results.total_failures)): | 312 if self._options.show_results and (exit_code or (self._options.f
ull_results_html and initial_results.total_failures)): |
| 313 self._port.show_results_html_file(results_path) | 313 self._port.show_results_html_file(results_path) |
| 314 self._printer.print_results(time.time() - start_time, initial_re
sults, summarized_failing_results) | 314 self._printer.print_results(time.time() - start_time, initial_re
sults, summarized_failing_results) |
| 315 |
| 316 self._check_for_stale_w3c_dir() |
| 317 |
| 315 return test_run_results.RunDetails(exit_code, summarized_full_results, s
ummarized_failing_results, initial_results, retry_results, enabled_pixel_tests_i
n_retry) | 318 return test_run_results.RunDetails(exit_code, summarized_full_results, s
ummarized_failing_results, initial_results, retry_results, enabled_pixel_tests_i
n_retry) |
| 316 | 319 |
| 317 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, n
um_workers, retrying): | 320 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, n
um_workers, retrying): |
| 318 | 321 |
| 319 test_inputs = [] | 322 test_inputs = [] |
| 320 for _ in xrange(iterations): | 323 for _ in xrange(iterations): |
| 321 for test in tests_to_run: | 324 for test in tests_to_run: |
| 322 for _ in xrange(repeat_each): | 325 for _ in xrange(repeat_each): |
| 323 test_inputs.append(self._test_input_for_file(test)) | 326 test_inputs.append(self._test_input_for_file(test)) |
| 324 return self._runner.run_tests(self._expectations, test_inputs, tests_to_
skip, num_workers, retrying) | 327 return self._runner.run_tests(self._expectations, test_inputs, tests_to_
skip, num_workers, retrying) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 347 def _clean_up_run(self): | 350 def _clean_up_run(self): |
| 348 _log.debug("Flushing stdout") | 351 _log.debug("Flushing stdout") |
| 349 sys.stdout.flush() | 352 sys.stdout.flush() |
| 350 _log.debug("Flushing stderr") | 353 _log.debug("Flushing stderr") |
| 351 sys.stderr.flush() | 354 sys.stderr.flush() |
| 352 _log.debug("Stopping helper") | 355 _log.debug("Stopping helper") |
| 353 self._port.stop_helper() | 356 self._port.stop_helper() |
| 354 _log.debug("Cleaning up port") | 357 _log.debug("Cleaning up port") |
| 355 self._port.clean_up_test_run() | 358 self._port.clean_up_test_run() |
| 356 | 359 |
| 360 def _check_for_stale_w3c_dir(self): |
| 361 # TODO(dpranke): Remove this check after 1/1/2015 and let people deal wi
th the warnings. |
| 362 # Remove the check in port/base.py as well. |
| 363 fs = self._port.host.filesystem |
| 364 layout_tests_dir = self._port.layout_tests_dir() |
| 365 if fs.isdir(fs.join(layout_tests_dir, 'w3c')): |
| 366 _log.warning('WARNING: You still have the old LayoutTests/w3c direct
ory in your checkout. You should delete it!') |
| 367 |
| 357 def _force_pixel_tests_if_needed(self): | 368 def _force_pixel_tests_if_needed(self): |
| 358 if self._options.pixel_tests: | 369 if self._options.pixel_tests: |
| 359 return False | 370 return False |
| 360 | 371 |
| 361 _log.debug("Restarting helper") | 372 _log.debug("Restarting helper") |
| 362 self._port.stop_helper() | 373 self._port.stop_helper() |
| 363 self._options.pixel_tests = True | 374 self._options.pixel_tests = True |
| 364 self._port.start_helper() | 375 self._port.start_helper() |
| 365 | 376 |
| 366 return True | 377 return True |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 return int(worker_name.split('/')[1]) if worker_name else -1 | 488 return int(worker_name.split('/')[1]) if worker_name else -1 |
| 478 | 489 |
| 479 stats = {} | 490 stats = {} |
| 480 for result in initial_results.results_by_name.values(): | 491 for result in initial_results.results_by_name.values(): |
| 481 if result.type != test_expectations.SKIP: | 492 if result.type != test_expectations.SKIP: |
| 482 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int
(result.total_run_time * 1000))} | 493 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int
(result.total_run_time * 1000))} |
| 483 stats_trie = {} | 494 stats_trie = {} |
| 484 for name, value in stats.iteritems(): | 495 for name, value in stats.iteritems(): |
| 485 json_results_generator.add_path_to_trie(name, value, stats_trie) | 496 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 486 return stats_trie | 497 return stats_trie |
| OLD | NEW |