[PATCH] D43694: Add a sanity check for inline tests

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 14:42:37 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326140: Add a sanity check for inline testcases. (authored by adrian, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43694?vs=135693&id=135990#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43694

Files:
  lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c
  lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py


Index: lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
@@ -182,14 +182,23 @@
         parser.set_breakpoints(target)
 
         process = target.LaunchSimple(None, None, self.getBuildDir())
+        hit_breakpoints = 0
 
         while lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint):
+            hit_breakpoints += 1
             thread = lldbutil.get_stopped_thread(
                 process, lldb.eStopReasonBreakpoint)
             breakpoint_id = thread.GetStopReasonDataAtIndex(0)
             parser.handle_breakpoint(self, breakpoint_id)
             process.Continue()
 
+        self.assertTrue(hit_breakpoints > 0,
+                        "inline test did not hit a single breakpoint")
+        # Either the process exited or the stepping plan is complete.
+        self.assertTrue(process.GetState() in [lldb.eStateStopped,
+                                               lldb.eStateExited],
+                        PROCESS_EXITED)
+
     # Utilities for testcases
 
     def check_expression(self, expression, expected_result, use_summary=True):
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c
@@ -21,4 +21,5 @@
 int main() {
     test2(42);
     test1(23);
+    return 0;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43694.135990.patch
Type: text/x-patch
Size: 1632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180226/6ef99ebc/attachment.bin>


More information about the llvm-commits mailing list