Changeset 47040 in webkit
- Timestamp:
- Aug 11, 2009 11:27:47 AM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r47039 r47040 1 2009-08-11 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Exception in land-patches 6 https://bugs.webkit.org/show_bug.cgi?id=27962 7 8 Use ("%s" % object) instead of ("" + object). 9 Added unit tests for logging.py. 10 11 * Scripts/modules/logging.py: 12 * Scripts/modules/logging_unittest.py: Added. 13 * Scripts/run-webkit-unittests: 14 1 15 2009-08-11 Dmitry Titov <dimich@chromium.org> 2 16 -
trunk/WebKitTools/Scripts/modules/logging.py
r45725 r47040 36 36 37 37 def error(string): 38 log("ERROR: " +string)38 log("ERROR: %s" % string) 39 39 exit(1) -
trunk/WebKitTools/Scripts/modules/logging_unittest.py
- Property svn:executable deleted
r47039 r47040 1 #!/usr/bin/python 2 # Copyright (c) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved. 3 2 # 4 3 # Redistribution and use in source and binary forms, with or without 5 4 # modification, are permitted provided that the following conditions are 6 5 # met: 7 # 8 # 6 # 7 # * Redistributions of source code must retain the above copyright 9 8 # notice, this list of conditions and the following disclaimer. 10 # 9 # * Redistributions in binary form must reproduce the above 11 10 # copyright notice, this list of conditions and the following disclaimer 12 11 # in the documentation and/or other materials provided with the 13 12 # distribution. 14 # 13 # * Neither the name of Google Inc. nor the names of its 15 14 # contributors may be used to endorse or promote products derived from 16 15 # this software without specific prior written permission. 17 # 16 # 18 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 28 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 28 29 import os 30 import subprocess 31 import StringIO 32 import tempfile 30 33 import unittest 31 34 32 from modules.bugzilla_unittest import * 33 from modules.commiters_unittest import * 34 from modules.cpp_style_unittest import * 35 from modules.diff_parser_unittest import * 36 from modules.scm_unittest import * 35 from modules.logging import * 36 from modules.scm import ScriptError 37 37 38 if __name__ == "__main__": 38 class LoggingTest(unittest.TestCase): 39 40 def assert_log_equals(self, log_input, expected_output): 41 original_stderr = sys.stderr 42 test_stderr = StringIO.StringIO() 43 sys.stderr = test_stderr 44 45 try: 46 log(log_input) 47 actual_output = test_stderr.getvalue() 48 finally: 49 original_stderr = original_stderr 50 51 self.assertEquals(actual_output, expected_output, "log(\"%s\") expected: %s actual: %s" % (log_input, expected_output, actual_output)) 52 53 def test_log(self): 54 self.assert_log_equals("test", "test\n") 55 56 # Test that log() does not throw an exception when passed an object instead of a string. 57 self.assert_log_equals(ScriptError("ScriptError"), "ScriptError\n") 58 59 60 if __name__ == '__main__': 39 61 unittest.main() -
trunk/WebKitTools/Scripts/run-webkit-unittests
r46898 r47040 34 34 from modules.cpp_style_unittest import * 35 35 from modules.diff_parser_unittest import * 36 from modules.logging_unittest import * 36 37 from modules.scm_unittest import * 37 38
Note: See TracChangeset
for help on using the changeset viewer.