[Lldb-commits] [lldb] r232372 - Fix the test for gcc.

Hafiz Abid Qadeer hafiz_abid at mentor.com
Mon Mar 16 05:16:20 PDT 2015


Author: abidh
Date: Mon Mar 16 07:16:19 2015
New Revision: 232372

URL: http://llvm.org/viewvc/llvm-project?rev=232372&view=rev
Log:
Fix the test for gcc.

Following 3 changes were made.
1. Test was assuming that function name will have () in the end. I dont know why lldb is generating function name like this but it looks like a bug. For this test, I have removed it.
2. Step instruction test was assuming that function call will not be the first instruction in the range of the line. This assumption failed with gcc. So I had fixed this.
3. Some minor adjustments with the line number.

Test with bot gcc and clang and all tests pass.

This test is still very fragile. We should be removing hardcoded line number.


Modified:
    lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py

Modified: lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py?rev=232372&r1=232371&r2=232372&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py Mon Mar 16 07:16:19 2015
@@ -230,7 +230,7 @@ class MiExecTestCase(lldbmi_testcase.MiT
         self.runCmd("-exec-next-instruction")
         self.expect("\^running")
         # Depending on compiler, it can stop at different line
-        self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"29\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"(29|30)\"")
 
         # Test that an invalid --thread is handled
         self.runCmd("-exec-next-instruction --thread 0")
@@ -283,7 +283,7 @@ class MiExecTestCase(lldbmi_testcase.MiT
         # (and that --thread is optional)
         self.runCmd("-exec-step --frame 0")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"")
         # Use -exec-finish here to make sure that control reaches the caller.
         # -exec-step can keep us in the g_MyFunction for gcc
         self.runCmd("-exec-finish --frame 0")
@@ -294,13 +294,13 @@ class MiExecTestCase(lldbmi_testcase.MiT
         # (and that --frame is optional)
         self.runCmd("-exec-step --thread 1")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"s_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"s_MyFunction.*\"")
 
         # Test that -exec-step steps into g_MyFunction from inside
         # s_MyFunction (and that both --thread and --frame are optional)
         self.runCmd("-exec-step")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"")
 
         # Test that an invalid --thread is handled
         self.runCmd("-exec-step --thread 0")
@@ -345,25 +345,25 @@ class MiExecTestCase(lldbmi_testcase.MiT
         # instruction
         self.runCmd("-exec-step-instruction --thread 1 --frame 0")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"2[8-9]\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\"")
 
         # Test that -exec-step-instruction steps into g_MyFunction
         # instruction (and that --thread is optional)
         self.runCmd("-exec-step-instruction --frame 0")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"")
 
         # Test that -exec-step-instruction steps over non branching
         # (and that --frame is optional)
         self.runCmd("-exec-step-instruction --thread 1")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"")
 
         # Test that -exec-step-instruction steps into g_MyFunction
         # (and that both --thread and --frame are optional)
         self.runCmd("-exec-step-instruction")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"")
 
         # Test that an invalid --thread is handled
         self.runCmd("-exec-step-instruction --thread 0")
@@ -418,7 +418,7 @@ class MiExecTestCase(lldbmi_testcase.MiT
         # s_MyFunction (and that --frame is optional)
         self.runCmd("-exec-finish --thread 1")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"s_MyFunction\(\)\"")
+        self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"s_MyFunction.*\"")
 
         # Test that -exec-finish returns from s_MyFunction
         # (and that both --thread and --frame are optional)





More information about the lldb-commits mailing list