[Lldb-commits] [lldb] [LLDB] Update breakpoint-command.test to use string instead of number. (PR #69796)

via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 20 16:35:30 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: None (cmtice)

<details>
<summary>Changes</summary>

lldb/test/Shell/Breakpoint/breakpoint-command.test adds a python command, to be executed when a breakpoint hits, that writes out a number. It then runs, hits the breakpoint and checks that the number is present exactly once.

The problem is that on some systems the test can be run in a filepath that happens to contain the number (e.g. auto-generated directory names). The number is then detected multiple times and the test fails.

This patch fixes the issue by using a string instead, particularly a string with spaces, which is very unlikely to be auto-generated by any system.

---
Full diff: https://github.com/llvm/llvm-project/pull/69796.diff


1 Files Affected:

- (modified) lldb/test/Shell/Breakpoint/breakpoint-command.test (+3-3) 


``````````diff
diff --git a/lldb/test/Shell/Breakpoint/breakpoint-command.test b/lldb/test/Shell/Breakpoint/breakpoint-command.test
index 2bca6a97e691cf3..8031be22dc2b6a2 100644
--- a/lldb/test/Shell/Breakpoint/breakpoint-command.test
+++ b/lldb/test/Shell/Breakpoint/breakpoint-command.test
@@ -1,7 +1,7 @@
 # REQUIRES: lua || python
 
 # RUN: %build %p/Inputs/dummy-target.c -o %t.out
-# RUN: %lldb %t.out -o 'b main' -o 'break command add 1 -o "script print(95000 + 126)"' -o 'r' | FileCheck %s
+# RUN: %lldb %t.out -o 'b main' -o 'break command add 1 -o "script print(\"A R4Nd0m\" + \" Str1ng\")"' -o 'r' | FileCheck %s
 
-# CHECK: 95126
-# CHECK-NOT: 95126
+# CHECK: A R4Nd0m Str1ng
+# CHECK-NOT: A R4Nd0m Str1ng

``````````

</details>


https://github.com/llvm/llvm-project/pull/69796


More information about the lldb-commits mailing list