[Lldb-commits] [lldb] r204284 - I changed the logging test to just test that logging doesn't crash and does produce output. That's

Jim Ingham jingham at apple.com
Wed Mar 19 16:55:54 PDT 2014


Author: jingham
Date: Wed Mar 19 18:55:54 2014
New Revision: 204284

URL: http://llvm.org/viewvc/llvm-project?rev=204284&view=rev
Log:
I changed the logging test to just test that logging doesn't crash and does produce output.  That's 
about all it is useful to test.

Modified:
    lldb/trunk/test/logging/TestLogging.py

Modified: lldb/trunk/test/logging/TestLogging.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/logging/TestLogging.py?rev=204284&r1=204283&r2=204284&view=diff
==============================================================================
--- lldb/trunk/test/logging/TestLogging.py (original)
+++ lldb/trunk/test/logging/TestLogging.py Wed Mar 19 18:55:54 2014
@@ -1,5 +1,5 @@
 """
-Test lldb logging.
+Test lldb logging.  This test just makes sure logging doesn't crash, and produces some output.
 """
 
 import os, time
@@ -14,13 +14,11 @@ class LogTestCase(TestBase):
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dsym_test
     def test_with_dsym (self):
-        self.skipTest ("This test case depends on the exact output of lldb log.  Why is that useful?")
         self.buildDsym ()
         self.command_log_tests ("dsym")
 
     @dwarf_test
     def test_with_dwarf (self):
-        self.skipTest ("This test case depends on the exact output of lldb log.  Why is that useful?")
         self.buildDwarf ()
         self.command_log_tests ("dwarf")
 
@@ -47,59 +45,16 @@ class LogTestCase(TestBase):
 
         self.runCmd ("bp l")
 
-        expected_log_lines = [
-            "Processing command: command alias bp breakpoint\n",
-            "HandleCommand, cmd_obj : 'command alias'\n",
-            "HandleCommand, revised_command_line: 'command alias bp breakpoint'\n",
-            "HandleCommand, wants_raw_input:'True'\n",
-            "HandleCommand, command line after removing command name(s): 'bp breakpoint'\n",
-            "HandleCommand, command succeeded\n",
-            "Processing command: bp set -n main\n",
-            "HandleCommand, cmd_obj : 'breakpoint set'\n",
-            "HandleCommand, revised_command_line: 'breakpoint set -n main'\n",
-            "HandleCommand, wants_raw_input:'False'\n",
-            "HandleCommand, command line after removing command name(s): '-n main'\n",
-            "HandleCommand, command succeeded\n",
-            "Processing command: bp l\n",
-            "HandleCommand, cmd_obj : 'breakpoint list'\n",
-            "HandleCommand, revised_command_line: 'breakpoint l'\n",
-            "HandleCommand, wants_raw_input:'False'\n",
-            "HandleCommand, command line after removing command name(s): ''\n",
-            "HandleCommand, command succeeded\n",
-            "Processing command: log disable lldb\n",
-            "HandleCommand, cmd_obj : 'log disable'\n",
-            "HandleCommand, revised_command_line: 'log disable lldb'\n",
-            "HandleCommand, wants_raw_input:'False'\n",
-            "HandleCommand, command line after removing command name(s): 'lldb'\n",
-            ]
-
         self.runCmd("log disable lldb")
 
         self.assertTrue (os.path.isfile (log_file))
 
-        idx = 0
-        end = len (expected_log_lines)
         f = open (log_file)
         log_lines = f.readlines()
         f.close ()
         os.remove (log_file)
 
-        err_msg = ""
-        success = True
-
-        if len (log_lines) != len (expected_log_lines):
-            success = False
-            err_msg = "Wrong number of lines in log file; expected: " + repr (len (expected_log_lines)) + " found: " + repr(len (log_lines))
-        else:
-            for line1, line2 in zip (log_lines, expected_log_lines):
-                if line1 != line2:
-                    success = False
-                    err_msg = "Expected '" + line2 + "'; Found '" + line1 + "'"
-                    break
-
-        if not success:
-            self.fail (err_msg)
-
+        self.assertTrue(log_lines > 0, "Something was written to the log file.")
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list