OLD | NEW |
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 results.append(output_api.PresubmitError('%s could not be parsed: %s' % | 464 results.append(output_api.PresubmitError('%s could not be parsed: %s' % |
465 (affected_file.LocalPath(), parse_error))) | 465 (affected_file.LocalPath(), parse_error))) |
466 return results | 466 return results |
467 | 467 |
468 | 468 |
469 def _RunPythonTests(input_api, output_api): | 469 def _RunPythonTests(input_api, output_api): |
470 def Join(*args): | 470 def Join(*args): |
471 return input_api.os_path.join(input_api.PresubmitLocalPath(), *args) | 471 return input_api.os_path.join(input_api.PresubmitLocalPath(), *args) |
472 | 472 |
473 test_directories = [ | 473 test_directories = [ |
474 Join('webrtc', 'tools', 'py_event_log_analyzer'), | 474 Join('webrtc', 'rtc_tools', 'py_event_log_analyzer'), |
475 Join('webrtc', 'tools'), | 475 Join('webrtc', 'rtc_tools'), |
476 Join('webrtc', 'audio', 'test', 'unittests'), | 476 Join('webrtc', 'audio', 'test', 'unittests'), |
477 ] + [ | 477 ] + [ |
478 root for root, _, files in os.walk(Join('tools_webrtc')) | 478 root for root, _, files in os.walk(Join('tools_webrtc')) |
479 if any(f.endswith('_test.py') for f in files) | 479 if any(f.endswith('_test.py') for f in files) |
480 ] | 480 ] |
481 | 481 |
482 tests = [] | 482 tests = [] |
483 for directory in test_directories: | 483 for directory in test_directories: |
484 tests.extend( | 484 tests.extend( |
485 input_api.canned_checks.GetUnitTestsInDirectory( | 485 input_api.canned_checks.GetUnitTestsInDirectory( |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 results = [] | 641 results = [] |
642 source_file_filter = lambda x: input_api.FilterSourceFile( | 642 source_file_filter = lambda x: input_api.FilterSourceFile( |
643 x, white_list=(r'.+\.proto$',)) | 643 x, white_list=(r'.+\.proto$',)) |
644 for f in input_api.AffectedSourceFiles(source_file_filter): | 644 for f in input_api.AffectedSourceFiles(source_file_filter): |
645 file_path = f.LocalPath() | 645 file_path = f.LocalPath() |
646 with open(file_path) as f: | 646 with open(file_path) as f: |
647 lines = f.readlines() | 647 lines = f.readlines() |
648 if lines[-1] != '\n' or lines[-2] == '\n': | 648 if lines[-1] != '\n' or lines[-2] == '\n': |
649 results.append(output_api.PresubmitError(error_msg.format(file_path))) | 649 results.append(output_api.PresubmitError(error_msg.format(file_path))) |
650 return results | 650 return results |
OLD | NEW |