From 0d830b42269476f3c3e2df2896fef0dbf86a73f2 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 16 Jul 2014 00:39:15 +0000 Subject: [PATCH] TestObjCMethods.FoundationTestCase was failing due to an error, fixed now. llvm.org/pr20267 llvm-svn: 213111 --- lldb/test/lang/objc/foundation/TestObjCMethods.py | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods.py b/lldb/test/lang/objc/foundation/TestObjCMethods.py index 7d9a635..7f9ecaf 100644 --- a/lldb/test/lang/objc/foundation/TestObjCMethods.py +++ b/lldb/test/lang/objc/foundation/TestObjCMethods.py @@ -10,6 +10,7 @@ import string from lldbtest import * import lldbutil +file_index = 0 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class FoundationTestCase(TestBase): @@ -119,7 +120,6 @@ class FoundationTestCase(TestBase): self.expression_lookups_objc() @dwarf_test - @expectedFailureDarwin("llvm.org/pr20267") def test_expression_lookups_objc_dwarf(self): """Test running an expression detect spurious debug info lookups (DWARF).""" self.buildDwarf() @@ -135,8 +135,10 @@ class FoundationTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) + global file_index # Log any DWARF lookups - logfile = os.path.join(os.getcwd(), "dwarf-lookups-" + self.getArchitecture() + ".txt") + ++file_index + logfile = os.path.join(os.getcwd(), "dwarf-lookups-" + self.getArchitecture() + "-" + str(file_index) + ".txt") self.runCmd("log enable -f %s dwarf lookups" % (logfile)) self.runCmd("expr self") self.runCmd("log disable dwarf lookups") @@ -147,17 +149,18 @@ class FoundationTestCase(TestBase): self.addTearDownHook(cleanup) - f = open(logfile) - lines = f.readlines() - num_errors = 0 - for line in lines: - if string.find(line, "$__lldb") != -1: - if num_errors == 0: - print "error: found spurious name lookups when evaluating an expression:" - num_errors += 1 - print line, - self.assertTrue(num_errors == 0, "Spurious lookups detected") - f.close() + if os.path.exists (logfile): + f = open(logfile) + lines = f.readlines() + num_errors = 0 + for line in lines: + if string.find(line, "$__lldb") != -1: + if num_errors == 0: + print "error: found spurious name lookups when evaluating an expression:" + num_errors += 1 + print line, + self.assertTrue(num_errors == 0, "Spurious lookups detected") + f.close() def setUp(self): # Call super's setUp(). -- 2.7.4