[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:34:31 PDT 2023
https://github.com/cmtice created https://github.com/llvm/llvm-project/pull/69796
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.
>From df5e5de1a6e5ece5dabb0f03492f0b918205fcdf Mon Sep 17 00:00:00 2001
From: Caroline Tice <cmtice at google.com>
Date: Fri, 20 Oct 2023 16:13:24 -0700
Subject: [PATCH] [LLDB] Update breakpoint-command.test to use string instead
of number.
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.
---
lldb/test/Shell/Breakpoint/breakpoint-command.test | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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
More information about the lldb-commits
mailing list