| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 results_directories = [] | 318 results_directories = [] |
| 319 for dir in file_list: | 319 for dir in file_list: |
| 320 file_path = self._filesystem.join(results_directory_path, dir) | 320 file_path = self._filesystem.join(results_directory_path, dir) |
| 321 if self._filesystem.isdir(file_path) and self._results_directory in
file_path: | 321 if self._filesystem.isdir(file_path) and self._results_directory in
file_path: |
| 322 results_directories.append(file_path) | 322 results_directories.append(file_path) |
| 323 results_directories.sort(key=lambda x: self._filesystem.mtime(x)) | 323 results_directories.sort(key=lambda x: self._filesystem.mtime(x)) |
| 324 self._printer.write_update("Clobbering excess archived results in %s" %
results_directory_path) | 324 self._printer.write_update("Clobbering excess archived results in %s" %
results_directory_path) |
| 325 self._delete_dirs(results_directories[:-self.ARCHIVED_RESULTS_LIMIT]) | 325 self._delete_dirs(results_directories[:-self.ARCHIVED_RESULTS_LIMIT]) |
| 326 | 326 |
| 327 def _set_up_run(self, test_names): | 327 def _set_up_run(self, test_names): |
| 328 exit_code = self._port.setup_test_run() | |
| 329 | |
| 330 self._printer.write_update("Checking build ...") | 328 self._printer.write_update("Checking build ...") |
| 331 if self._options.build: | 329 if self._options.build: |
| 332 exit_code = self._port.check_build(self._needs_servers(test_names),
self._printer) | 330 exit_code = self._port.check_build(self._needs_servers(test_names),
self._printer) |
| 333 if exit_code: | 331 if exit_code: |
| 334 _log.error("Build check failed") | 332 _log.error("Build check failed") |
| 335 return exit_code | 333 return exit_code |
| 336 | 334 |
| 335 # Check that the system dependencies (themes, fonts, ...) are correct. |
| 336 if not self._options.nocheck_sys_deps: |
| 337 self._printer.write_update("Checking system dependencies ...") |
| 338 exit_code = self._port.check_sys_deps(self._needs_servers(test_names
)) |
| 339 if exit_code: |
| 340 return exit_code |
| 341 |
| 337 if self._options.clobber_old_results: | 342 if self._options.clobber_old_results: |
| 338 self._clobber_old_results() | 343 self._clobber_old_results() |
| 339 elif self._filesystem.exists(self._results_directory): | 344 elif self._filesystem.exists(self._results_directory): |
| 340 self._limit_archived_results_count() | 345 self._limit_archived_results_count() |
| 341 # Rename the existing results folder for archiving. | 346 # Rename the existing results folder for archiving. |
| 342 self._rename_results_folder() | 347 self._rename_results_folder() |
| 343 | 348 |
| 344 # Create the output directory if it doesn't already exist. | 349 # Create the output directory if it doesn't already exist. |
| 345 self._port.host.filesystem.maybe_make_directory(self._results_directory) | 350 self._port.host.filesystem.maybe_make_directory(self._results_directory) |
| 346 | 351 |
| 347 # Check that the system dependencies (themes, fonts, ...) are correct. | 352 self._port.setup_test_run() |
| 348 if not self._options.nocheck_sys_deps: | |
| 349 self._printer.write_update("Checking system dependencies ...") | |
| 350 exit_code = self._port.check_sys_deps(self._needs_servers(test_names
)) | |
| 351 if exit_code: | |
| 352 return exit_code | |
| 353 | |
| 354 return exit_codes.OK_EXIT_STATUS | 353 return exit_codes.OK_EXIT_STATUS |
| 355 | 354 |
| 356 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, | 355 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, |
| 357 num_workers, retry_attempt=0): | 356 num_workers, retry_attempt=0): |
| 358 | 357 |
| 359 test_inputs = [] | 358 test_inputs = [] |
| 360 for _ in xrange(iterations): | 359 for _ in xrange(iterations): |
| 361 for test in tests_to_run: | 360 for test in tests_to_run: |
| 362 for _ in xrange(repeat_each): | 361 for _ in xrange(repeat_each): |
| 363 test_inputs.append(self._test_input_for_file(test)) | 362 test_inputs.append(self._test_input_for_file(test)) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 549 |
| 551 stats = {} | 550 stats = {} |
| 552 for result in initial_results.results_by_name.values(): | 551 for result in initial_results.results_by_name.values(): |
| 553 if result.type != test_expectations.SKIP: | 552 if result.type != test_expectations.SKIP: |
| 554 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( | 553 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( |
| 555 result.test_run_time * 1000), int(result.total_run_time * 10
00))} | 554 result.test_run_time * 1000), int(result.total_run_time * 10
00))} |
| 556 stats_trie = {} | 555 stats_trie = {} |
| 557 for name, value in stats.iteritems(): | 556 for name, value in stats.iteritems(): |
| 558 json_results_generator.add_path_to_trie(name, value, stats_trie) | 557 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 559 return stats_trie | 558 return stats_trie |
| OLD | NEW |