[Lldb-commits] [lldb] r155157 - /lldb/trunk/test/dotest.py

Johnny Chen johnny.chen at apple.com
Thu Apr 19 14:33:55 PDT 2012


Author: johnny
Date: Thu Apr 19 16:33:55 2012
New Revision: 155157

URL: http://llvm.org/viewvc/llvm-project?rev=155157&view=rev
Log:
LLDB test suite should also output the config info string along with the stack trace.
rdar://problem/11283401

Example:

Collected 1 test

1: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function. ... FAIL

======================================================================
FAIL: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 427, in wrapper
    return func(self, *args, **kwargs)
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 34, in test_with_dwarf
    self.call_function()
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 48, in call_function
    substrs = ['Hello world'])
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 1235, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'Hello world' returns expected result
Config=i386-clang
----------------------------------------------------------------------
Ran 1 test in 1.148s

FAILED (failures=1)

Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=155157&r1=155156&r2=155157&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Thu Apr 19 16:33:55 2012
@@ -1262,6 +1262,14 @@
                 # This counts from 1 .. suite.countTestCases().
                 self.counter = 0
 
+            def _exc_info_to_string(self, err, test):
+                """Overrides superclass TestResult's method in order to append
+                our test config info string to the exception info string."""
+                modified_exc_string = '%sConfig=%s-%s' % (super(LLDBTestResult, self)._exc_info_to_string(err, test),
+                                                          test.getArchitecture(),
+                                                          test.getCompiler())
+                return modified_exc_string
+
             def getDescription(self, test):
                 doc_first_line = test.shortDescription()
                 if self.descriptions and doc_first_line:





More information about the lldb-commits mailing list