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; }
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; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits