Author: Jonas Devlieghere Date: 2020-05-26T12:14:42-07:00 New Revision: ae903f0313e481520eff8a13044070aca4d0b75d
URL: https://github.com/llvm/llvm-project/commit/ae903f0313e481520eff8a13044070aca4d0b75d DIFF: https://github.com/llvm/llvm-project/commit/ae903f0313e481520eff8a13044070aca4d0b75d.diff LOG: [lldb/Test] Reinstate FoundationSymtabTestCase Added: Modified: lldb/test/API/lang/objc/foundation/TestSymbolTable.py Removed: ################################################################################ diff --git a/lldb/test/API/lang/objc/foundation/TestSymbolTable.py b/lldb/test/API/lang/objc/foundation/TestSymbolTable.py index b77a8dfc0ed9..f3331e829c27 100644 --- a/lldb/test/API/lang/objc/foundation/TestSymbolTable.py +++ b/lldb/test/API/lang/objc/foundation/TestSymbolTable.py @@ -40,13 +40,25 @@ def test_with_python_api(self): process = target.LaunchSimple( None, None, self.get_process_working_directory()) - # - # Exercise Python APIs to access the symbol table entries. - # - # Create the filespec by which to locate our a.out module. filespec = lldb.SBFileSpec(exe, False) module = target.FindModule(filespec) self.assertTrue(module, VALID_MODULE) + # Create the set of known symbols. As we iterate through the symbol + # table, remove the symbol from the set if it is a known symbol. + expected_symbols = set(self.symbols_list) + for symbol in module: + self.assertTrue(symbol, VALID_SYMBOL) + #print("symbol:", symbol) + name = symbol.GetName() + if name in expected_symbols: + #print("Removing %s from known_symbols %s" % (name, expected_symbols)) + expected_symbols.remove(name) + + # At this point, the known_symbols set should have become an empty set. + # If not, raise an error. + #print("symbols unaccounted for:", expected_symbols) + self.assertTrue(len(expected_symbols) == 0, + "All the known symbols are accounted for") _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits