webkitpy: test_function_length_check_definition_huge_lines is slow
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 18:19:30 +0000 (18:19 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 18:19:30 +0000 (18:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79185

Reviewed by Adam Barth.

This test takes ~3 seconds to run, apparently because we're
running a test on a 10,000 line function :). Dropping the
function length to 640 still exercises the code path and
provides a 10x speedup.

* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest):
(CheckForFunctionLengthsTest.test_function_length_check_definition_huge_lines):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108515 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index d6a494f..b260a64 100644 (file)
@@ -1,5 +1,21 @@
 2012-02-22  Dirk Pranke  <dpranke@chromium.org>
 
+        webkitpy: test_function_length_check_definition_huge_lines is slow
+        https://bugs.webkit.org/show_bug.cgi?id=79185
+
+        Reviewed by Adam Barth.
+
+        This test takes ~3 seconds to run, apparently because we're
+        running a test on a 10,000 line function :). Dropping the
+        function length to 640 still exercises the code path and
+        provides a 10x speedup.
+
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (CppStyleTest):
+        (CheckForFunctionLengthsTest.test_function_length_check_definition_huge_lines):
+
+2012-02-22  Dirk Pranke  <dpranke@chromium.org>
+
         webkitpy: speed up FileLockTest.test_lock_lifecycle
         https://bugs.webkit.org/show_bug.cgi?id=79189
 
index 544e830..044f46b 100644 (file)
@@ -783,7 +783,7 @@ class CppStyleTest(CppStyleTestBase):
     #   self.assert_lint('void Method(char* /*x*/);', message)
     #   self.assert_lint('typedef void (*Method)(int32);', message)
     #   self.assert_lint('static void operator delete[](void*) throw();', message)
-    # 
+    #
     #   self.assert_lint('virtual void D(int* p);', '')
     #   self.assert_lint('void operator delete(void* x) throw();', '')
     #   self.assert_lint('void Method(char* x)\n{', '')
@@ -792,7 +792,7 @@ class CppStyleTest(CppStyleTestBase):
     #   self.assert_lint('typedef void (*Method)(int32 x);', '')
     #   self.assert_lint('static void operator delete[](void* x) throw();', '')
     #   self.assert_lint('static void operator delete[](void* /*x*/) throw();', '')
-    # 
+    #
     #   # This one should technically warn, but doesn't because the function
     #   # pointer is confusing.
     #   self.assert_lint('virtual void E(void (*fn)(int* p));', '')
@@ -3072,7 +3072,7 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
 
     def test_function_length_check_definition_huge_lines(self):
         # 5 is the limit
-        self.assert_function_length_check_definition(self.trigger_lines(10), 5)
+        self.assert_function_length_check_definition(self.trigger_lines(6), 5)
 
     def test_function_length_not_determinable(self):
         # Macro invocation without terminating semicolon.