[Lldb-commits] [lldb] r245412 - Fix TestCppNsImport and TestCppScope for remote tests.

Chaoren Lin via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 18 21:08:56 PDT 2015


Author: chaoren
Date: Tue Aug 18 23:08:56 2015
New Revision: 245412

URL: http://llvm.org/viewvc/llvm-project?rev=245412&view=rev
Log:
Fix TestCppNsImport and TestCppScope for remote tests.

Modified:
    lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py
    lldb/trunk/test/lang/cpp/scope/TestCppScope.py

Modified: lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py?rev=245412&r1=245411&r2=245412&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py (original)
+++ lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py Tue Aug 18 23:08:56 2015
@@ -6,9 +6,9 @@ from lldbtest import *
 import lldbutil
 
 class TestCppNsImport(TestBase):
-    
+
     mydir = TestBase.compute_mydir(__file__)
-    
+
     @skipUnlessDarwin
     @dsym_test
     def test_with_dsym_and_run_command(self):
@@ -32,12 +32,12 @@ class TestCppNsImport(TestBase):
         src_file = "main.cpp"
         src_file_spec = lldb.SBFileSpec(src_file)
         self.assertTrue(src_file_spec.IsValid(), "Main source file")
-        
+
         # Get the path of the executable
-        cwd = os.getcwd() 
+        cwd = os.getcwd()
         exe_file = "a.out"
         exe_path  = os.path.join(cwd, exe_file)
-        
+
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
         self.assertTrue(target.IsValid(), VALID_TARGET)
@@ -49,20 +49,20 @@ class TestCppNsImport(TestBase):
         # Launch the process
         args = None
         env = None
-        process = target.LaunchSimple(args, env, cwd)
+        process = target.LaunchSimple(args, env, self.get_process_working_directory())
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
         # Get the thread of the process
         self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
 
-        # Get current fream of the thread at the breakpoint 
+        # Get current fream of the thread at the breakpoint
         frame = thread.GetSelectedFrame()
 
         # Test imported namespaces
         test_result = frame.EvaluateExpression("x")
         self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 11, "x = 11")
-        
+
         test_result = frame.EvaluateExpression("xx")
         self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 22, "xx = 22")
 

Modified: lldb/trunk/test/lang/cpp/scope/TestCppScope.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/scope/TestCppScope.py?rev=245412&r1=245411&r2=245412&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/scope/TestCppScope.py (original)
+++ lldb/trunk/test/lang/cpp/scope/TestCppScope.py Tue Aug 18 23:08:56 2015
@@ -6,9 +6,9 @@ from lldbtest import *
 import lldbutil
 
 class TestCppScopes(TestBase):
-    
+
     mydir = TestBase.compute_mydir(__file__)
-    
+
     @skipUnlessDarwin
     @dsym_test
     def test_with_dsym_and_run_command(self):
@@ -28,12 +28,12 @@ class TestCppScopes(TestBase):
         src_file = "main.cpp"
         src_file_spec = lldb.SBFileSpec(src_file)
         self.assertTrue(src_file_spec.IsValid(), "Main source file")
-        
+
         # Get the path of the executable
-        cwd = os.getcwd() 
+        cwd = os.getcwd()
         exe_file = "a.out"
         exe_path  = os.path.join(cwd, exe_file)
-        
+
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
         self.assertTrue(target.IsValid(), VALID_TARGET)
@@ -45,20 +45,20 @@ class TestCppScopes(TestBase):
         # Launch the process
         args = None
         env = None
-        process = target.LaunchSimple(args, env, cwd)
+        process = target.LaunchSimple(args, env, self.get_process_working_directory())
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
         # Get the thread of the process
         self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
 
-        # Get current fream of the thread at the breakpoint 
+        # Get current fream of the thread at the breakpoint
         frame = thread.GetSelectedFrame()
 
-        # Test result for scopes of variables 
+        # Test result for scopes of variables
 
         global_variables = frame.GetVariables(True, True, True, False)
-        global_variables_assert = { 
+        global_variables_assert = {
             'A::a': 1111,
             'B::a': 2222,
             'C::a': 3333,
@@ -68,7 +68,7 @@ class TestCppScopes(TestBase):
 
         self.assertTrue(global_variables.GetSize() == 4, "target variable returns all variables")
         for variable in global_variables:
-            name = variable.GetName() 
+            name = variable.GetName()
             self.assertTrue(name in global_variables_assert, "target variable returns wrong variable " + name)
 
         for name in global_variables_assert:




More information about the lldb-commits mailing list