diff options
author | Jim Ingham <jingham@apple.com> | 2014-03-19 23:55:54 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-03-19 23:55:54 +0000 |
commit | c49d0d4fe6eb9ab66a14049e220fd34d72473fb5 (patch) | |
tree | 10f427f715f52c827715239a04043d043ad89716 | |
parent | a7d63fc610ab2ef5d1cfd0d6263e2e86e324ef66 (diff) | |
download | bcm5719-llvm-c49d0d4fe6eb9ab66a14049e220fd34d72473fb5.tar.gz bcm5719-llvm-c49d0d4fe6eb9ab66a14049e220fd34d72473fb5.zip |
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.
llvm-svn: 204284
-rw-r--r-- | lldb/test/logging/TestLogging.py | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/lldb/test/logging/TestLogging.py b/lldb/test/logging/TestLogging.py index 376271651f7..11d4321c05a 100644 --- a/lldb/test/logging/TestLogging.py +++ b/lldb/test/logging/TestLogging.py @@ -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 |