Title: [98264] trunk/Tools
Revision
98264
Author
[email protected]
Date
2011-10-24 12:02:21 -0700 (Mon, 24 Oct 2011)

Log Message

check-webkit-style complains about WEBKIT_EXPORT in test/WebUnitTests.h
https://bugs.webkit.org/show_bug.cgi?id=70747

Reviewed by Tony Chang.

* Scripts/webkitpy/style/checkers/cpp.py: Allow WEBKIT_EXPORT in tests dir.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Corresponding test.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (98263 => 98264)


--- trunk/Tools/ChangeLog	2011-10-24 18:56:16 UTC (rev 98263)
+++ trunk/Tools/ChangeLog	2011-10-24 19:02:21 UTC (rev 98264)
@@ -1,3 +1,13 @@
+2011-10-24  David Levin  <[email protected]>
+
+        check-webkit-style complains about WEBKIT_EXPORT in test/WebUnitTests.h
+        https://bugs.webkit.org/show_bug.cgi?id=70747
+
+        Reviewed by Tony Chang.
+
+        * Scripts/webkitpy/style/checkers/cpp.py: Allow WEBKIT_EXPORT in tests dir.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Corresponding test.
+
 2011-10-24  Balazs Kelemen  <[email protected]>
 
         [Qt][WK2] Crash when running pixel tests

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (98263 => 98264)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-10-24 18:56:16 UTC (rev 98263)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-10-24 19:02:21 UTC (rev 98264)
@@ -1602,9 +1602,9 @@
 
     modifiers_and_return_type = function_state.modifiers_and_return_type()
     if filename.find('/chromium/') != -1 and search(r'\bWEBKIT_EXPORT\b', modifiers_and_return_type):
-        if filename.find('/chromium/public/') == -1:
+        if filename.find('/chromium/public/') == -1 and filename.find('/chromium/tests/') == -1:
             error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,
-                  'WEBKIT_EXPORT should only appear in the chromium public directory.')
+                  'WEBKIT_EXPORT should only appear in the chromium public (or tests) directory.')
         elif not file_extension == "h":
             error(function_state.function_name_start_position.row, 'readability/webkit_export', 5,
                   'WEBKIT_EXPORT should only be used in header files.')

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (98263 => 98264)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-10-24 18:56:16 UTC (rev 98263)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-10-24 19:02:21 UTC (rev 98264)
@@ -4524,11 +4524,15 @@
                           self.perform_lint('WEBKIT_EXPORT int foo();\n',
                                             'WebKit/chromium/public/test.h',
                                             webkit_export_error_rules))
+        self.assertEquals('',
+                          self.perform_lint('WEBKIT_EXPORT int foo();\n',
+                                            'WebKit/chromium/tests/test.h',
+                                            webkit_export_error_rules))
         self.assertEquals('WEBKIT_EXPORT should only be used in header files.  [readability/webkit_export] [5]',
                           self.perform_lint('WEBKIT_EXPORT int foo();\n',
                                             'WebKit/chromium/public/test.cpp',
                                             webkit_export_error_rules))
-        self.assertEquals('WEBKIT_EXPORT should only appear in the chromium public directory.  [readability/webkit_export] [5]',
+        self.assertEquals('WEBKIT_EXPORT should only appear in the chromium public (or tests) directory.  [readability/webkit_export] [5]',
                           self.perform_lint('WEBKIT_EXPORT int foo();\n',
                                             'WebKit/chromium/src/test.h',
                                             webkit_export_error_rules))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to