| OLD | NEW |
| 1 # -*- coding: utf-8; -*- | 1 # -*- coding: utf-8; -*- |
| 2 # | 2 # |
| 3 # Copyright (C) 2009 Google Inc. All rights reserved. | 3 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 # Copyright (C) 2009 Torch Mobile Inc. | 4 # Copyright (C) 2009 Torch Mobile Inc. |
| 5 # Copyright (C) 2009 Apple Inc. All rights reserved. | 5 # Copyright (C) 2009 Apple Inc. All rights reserved. |
| 6 # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) | 6 # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) |
| 7 # | 7 # |
| 8 # Redistribution and use in source and binary forms, with or without | 8 # Redistribution and use in source and binary forms, with or without |
| 9 # modification, are permitted provided that the following conditions are | 9 # modification, are permitted provided that the following conditions are |
| 10 # met: | 10 # met: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 33 | 33 |
| 34 """Unit tests for style.py.""" | 34 """Unit tests for style.py.""" |
| 35 | 35 |
| 36 import logging | 36 import logging |
| 37 import os | 37 import os |
| 38 import unittest | 38 import unittest |
| 39 | 39 |
| 40 import checker as style | 40 import checker as style |
| 41 from webkitpy.common.system.logtesting import LogTesting, TestLogStream | 41 from webkitpy.common.system.logtesting import TestLogStream |
| 42 from checker import _BASE_FILTER_RULES | 42 from checker import _BASE_FILTER_RULES |
| 43 from checker import _MAX_REPORTS_PER_CATEGORY | 43 from checker import _MAX_REPORTS_PER_CATEGORY |
| 44 from checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER | 44 from checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER |
| 45 from checker import _all_categories | 45 from checker import _all_categories |
| 46 from checker import check_webkit_style_configuration | 46 from checker import check_webkit_style_configuration |
| 47 from checker import check_webkit_style_parser | 47 from checker import check_webkit_style_parser |
| 48 from checker import configure_logging | 48 from checker import configure_logging |
| 49 from checker import CheckerDispatcher | 49 from checker import CheckerDispatcher |
| 50 from checker import ProcessorBase | |
| 51 from checker import StyleProcessor | 50 from checker import StyleProcessor |
| 52 from checker import StyleProcessorConfiguration | 51 from checker import StyleProcessorConfiguration |
| 53 from checkers.cpp import CppChecker | 52 from checkers.cpp import CppChecker |
| 54 from checkers.jsonchecker import JSONChecker | 53 from checkers.jsonchecker import JSONChecker |
| 55 from checkers.python import PythonChecker | 54 from checkers.python import PythonChecker |
| 56 from checkers.text import TextChecker | 55 from checkers.text import TextChecker |
| 57 from checkers.xml import XMLChecker | 56 from checkers.xml import XMLChecker |
| 58 from error_handlers import DefaultStyleErrorHandler | 57 from error_handlers import DefaultStyleErrorHandler |
| 59 from filter import validate_filter_rules | 58 from filter import validate_filter_rules |
| 60 from filter import FilterConfiguration | 59 from filter import FilterConfiguration |
| 61 from optparser import ArgumentParser | 60 from optparser import ArgumentParser |
| 62 from optparser import CommandOptionValues | 61 from optparser import CommandOptionValues |
| 63 from webkitpy.common.system.logtesting import LoggingTestCase | 62 from webkitpy.common.system.logtesting import LoggingTestCase |
| 64 from webkitpy.style.filereader import TextFileReader | |
| 65 | 63 |
| 66 | 64 |
| 67 class ConfigureLoggingTestBase(unittest.TestCase): | 65 class ConfigureLoggingTestBase(unittest.TestCase): |
| 68 | 66 |
| 69 """Base class for testing configure_logging(). | 67 """Base class for testing configure_logging(). |
| 70 | 68 |
| 71 Sub-classes should implement: | 69 Sub-classes should implement: |
| 72 | 70 |
| 73 is_verbose: The is_verbose value to pass to configure_logging(). | 71 is_verbose: The is_verbose value to pass to configure_logging(). |
| 74 | 72 |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 """Test that carriage returns aren't stripped from files that are allowe
d to contain them.""" | 807 """Test that carriage returns aren't stripped from files that are allowe
d to contain them.""" |
| 810 file_path = 'carriage_returns_allowed.txt' | 808 file_path = 'carriage_returns_allowed.txt' |
| 811 lines = ['line1\r', 'line2\r'] | 809 lines = ['line1\r', 'line2\r'] |
| 812 line_numbers = [100] | 810 line_numbers = [100] |
| 813 self._processor.process(lines=lines, | 811 self._processor.process(lines=lines, |
| 814 file_path=file_path, | 812 file_path=file_path, |
| 815 line_numbers=line_numbers) | 813 line_numbers=line_numbers) |
| 816 # The carriage return checker should never have been invoked, and so | 814 # The carriage return checker should never have been invoked, and so |
| 817 # should not have saved off any lines. | 815 # should not have saved off any lines. |
| 818 self.assertFalse(hasattr(self.carriage_checker, 'lines')) | 816 self.assertFalse(hasattr(self.carriage_checker, 'lines')) |
| OLD | NEW |