[Lldb-commits] [lldb] [lldb][test] Remove full stop from expected error messages (PR #193748)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 23 06:51:51 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

I am about to update a bunch of uses of AppendErrorWithFormat to not have a full stop at the end, to confirm to
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages.

Reviewing all those changes is going to be difficult so I am updating the tests first and then we can land the other changes in batches (because the tests will continue to pass as we do that).

Note that I have only run the test suite on Linux AArch64, so there are probably more that need to be updated. We will catch those in CI or post-commit.

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


20 Files Affected:

- (modified) lldb/test/API/commands/breakpoint/command/list/TestBreakpointCommandList.py (+1-1) 
- (modified) lldb/test/API/commands/command/container/TestContainerCommands.py (+2-2) 
- (modified) lldb/test/API/commands/command/delete/TestCommandDelete.py (+1-1) 
- (modified) lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py (+2-4) 
- (modified) lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py (+1-1) 
- (modified) lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py (+10-10) 
- (modified) lldb/test/API/commands/log/invalid-args/TestInvalidArgsLog.py (+2-4) 
- (modified) lldb/test/API/commands/process/signal/TestProcessSignal.py (+3-3) 
- (modified) lldb/test/API/commands/register/register_command/TestRegisters.py (+2-2) 
- (modified) lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py (+2-2) 
- (modified) lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py (+2-2) 
- (modified) lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py (+2-2) 
- (modified) lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py (+2-2) 
- (modified) lldb/test/API/commands/thread/select/TestThreadSelect.py (+1-1) 
- (modified) lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (+1-1) 
- (modified) lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py (+3-3) 
- (modified) lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py (+1-1) 
- (modified) lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py (+1-1) 
- (modified) lldb/test/Shell/Commands/list-header.test (+1-1) 
- (modified) lldb/test/Shell/Minidump/disassemble-no-module.yaml (+1-1) 


``````````diff
diff --git a/lldb/test/API/commands/breakpoint/command/list/TestBreakpointCommandList.py b/lldb/test/API/commands/breakpoint/command/list/TestBreakpointCommandList.py
index 8fc665ff85ea7..e43ab760e674f 100644
--- a/lldb/test/API/commands/breakpoint/command/list/TestBreakpointCommandList.py
+++ b/lldb/test/API/commands/breakpoint/command/list/TestBreakpointCommandList.py
@@ -52,5 +52,5 @@ def test_list_commands(self):
         self.expect(
             "breakpoint command list 2",
             error=True,
-            startstr="error: '2' is not a currently valid breakpoint ID.",
+            startstr="error: '2' is not a currently valid breakpoint ID",
         )
diff --git a/lldb/test/API/commands/command/container/TestContainerCommands.py b/lldb/test/API/commands/command/container/TestContainerCommands.py
index 4a168d3474e34..34b7d0939d78c 100644
--- a/lldb/test/API/commands/command/container/TestContainerCommands.py
+++ b/lldb/test/API/commands/command/container/TestContainerCommands.py
@@ -237,7 +237,7 @@ def container_add(self):
         self.expect(
             "test-multi test-multi-sub welcome friend",
             "did remove subcommand",
-            substrs=["'test-multi-sub' does not have any subcommands."],
+            substrs=["'test-multi-sub' does not have any subcommands"],
             error=True,
         )
         # We should have the new help:
@@ -262,6 +262,6 @@ def container_add(self):
         self.expect(
             "test-multi",
             "Root command gone",
-            substrs=["'test-multi' is not a valid command."],
+            substrs=["'test-multi' is not a valid command"],
             error=True,
         )
diff --git a/lldb/test/API/commands/command/delete/TestCommandDelete.py b/lldb/test/API/commands/command/delete/TestCommandDelete.py
index aacf9326e4765..bfcef6e0caf6e 100644
--- a/lldb/test/API/commands/command/delete/TestCommandDelete.py
+++ b/lldb/test/API/commands/command/delete/TestCommandDelete.py
@@ -10,7 +10,7 @@ def test_delete_builtin(self):
             "command delete settings",
             error=True,
             substrs=[
-                "'settings' is a permanent debugger command and cannot be removed."
+                "'settings' is a permanent debugger command and cannot be removed"
             ],
         )
 
diff --git a/lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py b/lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py
index 072f832335cf2..a634c516617cd 100644
--- a/lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py
+++ b/lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py
@@ -54,7 +54,7 @@ def test_alias(self):
             "command alias blub foo",
             error=True,
             substrs=[
-                "error: invalid command given to 'command alias'. 'foo' does not begin with a valid command.  No alias created."
+                "error: invalid command given to 'command alias'. 'foo' does not begin with a valid command.  No alias created"
             ],
         )
 
@@ -87,7 +87,5 @@ def test_source(self):
         self.expect(
             "command source",
             error=True,
-            substrs=[
-                "'command source' takes exactly one executable filename argument."
-            ],
+            substrs=["'command source' takes exactly one executable filename argument"],
         )
diff --git a/lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py b/lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py
index eb812f1902e66..257c2691f6705 100644
--- a/lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py
+++ b/lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py
@@ -91,7 +91,7 @@ def test_allow_jit_with_top_level(self):
         self.expect(
             "expr --allow-jit false --top-level -- int i;",
             error=True,
-            substrs=["Can't disable JIT compilation for top-level expressions."],
+            substrs=["Can't disable JIT compilation for top-level expressions"],
         )
 
         self.build()
diff --git a/lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py b/lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py
index 3e9dbfe6d8555..e0c107fc51302 100644
--- a/lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py
+++ b/lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py
@@ -73,12 +73,12 @@ def test_frame_recognizer_1(self):
         self.expect(
             "frame recognizer delete 2",
             error=True,
-            substrs=["error: '2' is not a valid recognizer id."],
+            substrs=["error: '2' is not a valid recognizer id"],
         )
         self.expect(
             "frame recognizer delete 0",
             error=True,
-            substrs=["error: '0' is not a valid recognizer id."],
+            substrs=["error: '0' is not a valid recognizer id"],
         )
         # Recognizers should have the same state as above.
         self.expect(
@@ -448,22 +448,22 @@ def test_frame_recognizer_delete_invalid_arg(self):
         self.expect(
             "frame recognizer delete a",
             error=True,
-            substrs=["error: 'a' is not a valid recognizer id."],
+            substrs=["error: 'a' is not a valid recognizer id"],
         )
         self.expect(
             'frame recognizer delete ""',
             error=True,
-            substrs=["error: '' is not a valid recognizer id."],
+            substrs=["error: '' is not a valid recognizer id"],
         )
         self.expect(
             "frame recognizer delete -1",
             error=True,
-            substrs=["error: '-1' is not a valid recognizer id."],
+            substrs=["error: '-1' is not a valid recognizer id"],
         )
         self.expect(
             "frame recognizer delete 4294967297",
             error=True,
-            substrs=["error: '4294967297' is not a valid recognizer id."],
+            substrs=["error: '4294967297' is not a valid recognizer id"],
         )
 
     @no_debug_info_test
@@ -471,22 +471,22 @@ def test_frame_recognizer_info_invalid_arg(self):
         self.expect(
             "frame recognizer info a",
             error=True,
-            substrs=["error: 'a' is not a valid frame index."],
+            substrs=["error: 'a' is not a valid frame index"],
         )
         self.expect(
             'frame recognizer info ""',
             error=True,
-            substrs=["error: '' is not a valid frame index."],
+            substrs=["error: '' is not a valid frame index"],
         )
         self.expect(
             "frame recognizer info -1",
             error=True,
-            substrs=["error: '-1' is not a valid frame index."],
+            substrs=["error: '-1' is not a valid frame index"],
         )
         self.expect(
             "frame recognizer info 4294967297",
             error=True,
-            substrs=["error: '4294967297' is not a valid frame index."],
+            substrs=["error: '4294967297' is not a valid frame index"],
         )
 
     @no_debug_info_test
diff --git a/lldb/test/API/commands/log/invalid-args/TestInvalidArgsLog.py b/lldb/test/API/commands/log/invalid-args/TestInvalidArgsLog.py
index dbcd2d60d021a..96089bd04ab85 100644
--- a/lldb/test/API/commands/log/invalid-args/TestInvalidArgsLog.py
+++ b/lldb/test/API/commands/log/invalid-args/TestInvalidArgsLog.py
@@ -9,9 +9,7 @@ def test_enable_empty(self):
         self.expect(
             "log enable",
             error=True,
-            substrs=[
-                "error: log enable takes a log channel and one or more log types."
-            ],
+            substrs=["error: log enable takes a log channel and one or more log types"],
         )
 
     @no_debug_info_test
@@ -20,7 +18,7 @@ def test_disable_empty(self):
             "log disable",
             error=True,
             substrs=[
-                "error: log disable takes a log channel and one or more log types."
+                "error: log disable takes a log channel and one or more log types"
             ],
         )
 
diff --git a/lldb/test/API/commands/process/signal/TestProcessSignal.py b/lldb/test/API/commands/process/signal/TestProcessSignal.py
index 2a404dd2bb3b7..96bdad6573f5f 100644
--- a/lldb/test/API/commands/process/signal/TestProcessSignal.py
+++ b/lldb/test/API/commands/process/signal/TestProcessSignal.py
@@ -15,15 +15,15 @@ def test_invalid_arg(self):
         self.expect(
             "process signal az",
             error=True,
-            startstr="error: Invalid signal argument 'az'.",
+            startstr="error: Invalid signal argument 'az'",
         )
         self.expect(
             "process signal 0x1ffffffff",
             error=True,
-            startstr="error: Invalid signal argument '0x1ffffffff'.",
+            startstr="error: Invalid signal argument '0x1ffffffff'",
         )
         self.expect(
             "process signal 0xffffffff",
             error=True,
-            startstr="error: Invalid signal argument '0xffffffff'.",
+            startstr="error: Invalid signal argument '0xffffffff'",
         )
diff --git a/lldb/test/API/commands/register/register_command/TestRegisters.py b/lldb/test/API/commands/register/register_command/TestRegisters.py
index 29d090a279070..d7863a230cdb8 100644
--- a/lldb/test/API/commands/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register_command/TestRegisters.py
@@ -579,7 +579,7 @@ def test_write_unknown_register(self):
         self.expect(
             "register write blub 1",
             error=True,
-            substrs=["error: Register not found for 'blub'."],
+            substrs=["error: Register not found for 'blub'"],
         )
 
     def test_info_unknown_register(self):
@@ -589,7 +589,7 @@ def test_info_unknown_register(self):
         self.expect(
             "register info blub",
             error=True,
-            substrs=["error: No register found with name 'blub'."],
+            substrs=["error: No register found with name 'blub'"],
         )
 
     def test_info_many_registers(self):
diff --git a/lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py b/lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py
index 86bcd018a795f..b00067772b504 100644
--- a/lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py
+++ b/lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py
@@ -14,11 +14,11 @@ def test_invalid_arg(self):
         self.expect(
             "target modules search-paths insert -1 a b",
             error=True,
-            startstr="error: <index> parameter is not an integer: '-1'.",
+            startstr="error: <index> parameter is not an integer: '-1'",
         )
 
         self.expect(
             "target modules search-paths insert abcdefx a b",
             error=True,
-            startstr="error: <index> parameter is not an integer: 'abcdefx'.",
+            startstr="error: <index> parameter is not an integer: 'abcdefx'",
         )
diff --git a/lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py b/lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py
index 74590995ae9bb..cf97b4bc53fa0 100644
--- a/lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py
+++ b/lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py
@@ -10,10 +10,10 @@ def test_invalid_arg(self):
         self.expect(
             "target stop-hook delete -1",
             error=True,
-            startstr='error: invalid stop hook id: "-1".',
+            startstr='error: invalid stop hook id: "-1"',
         )
         self.expect(
             "target stop-hook delete abcdfx",
             error=True,
-            startstr='error: invalid stop hook id: "abcdfx".',
+            startstr='error: invalid stop hook id: "abcdfx"',
         )
diff --git a/lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py b/lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py
index b30e8fa8dcd44..c1459368a86f8 100644
--- a/lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py
+++ b/lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py
@@ -10,10 +10,10 @@ def test_invalid_arg(self):
         self.expect(
             "target stop-hook disable -1",
             error=True,
-            startstr='error: invalid stop hook id: "-1".',
+            startstr='error: invalid stop hook id: "-1"',
         )
         self.expect(
             "target stop-hook disable abcdfx",
             error=True,
-            startstr='error: invalid stop hook id: "abcdfx".',
+            startstr='error: invalid stop hook id: "abcdfx"',
         )
diff --git a/lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py b/lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py
index 6589c7eb4f632..0b180cfb08b10 100644
--- a/lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py
+++ b/lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py
@@ -10,10 +10,10 @@ def test_invalid_arg(self):
         self.expect(
             "target stop-hook enable -1",
             error=True,
-            startstr='error: invalid stop hook id: "-1".',
+            startstr='error: invalid stop hook id: "-1"',
         )
         self.expect(
             "target stop-hook enable abcdfx",
             error=True,
-            startstr='error: invalid stop hook id: "abcdfx".',
+            startstr='error: invalid stop hook id: "abcdfx"',
         )
diff --git a/lldb/test/API/commands/thread/select/TestThreadSelect.py b/lldb/test/API/commands/thread/select/TestThreadSelect.py
index 2a2cef4a905c9..6d95bac1bdb60 100644
--- a/lldb/test/API/commands/thread/select/TestThreadSelect.py
+++ b/lldb/test/API/commands/thread/select/TestThreadSelect.py
@@ -36,7 +36,7 @@ def test_invalid_arg(self):
         self.expect(
             "thread select 0xffffffff",
             error=True,
-            startstr="error: Invalid thread index #0xffffffff.",
+            startstr="error: Invalid thread index #0xffffffff",
         )
         self.expect(
             "thread select -t 0xffffffff",
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index e45362295690d..6139584c1b0d9 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -383,7 +383,7 @@ def breakpoint_command_sequence(self):
         self.expect(
             "breakpoint command list 2",
             error=True,
-            startstr="error: '2' is not a currently valid breakpoint ID.",
+            startstr="error: '2' is not a currently valid breakpoint ID",
         )
 
         # The breakpoint list now only contains breakpoint 1.
diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
index db5b5a0e0d0cb..d2e20b54a9d3b 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
@@ -881,7 +881,7 @@ def haltReason(self):
         self.match("register read rdx", ["rdx = 0x1817161514131211"])
         # edx should not be added
         self.match(
-            "register read edx", ["error: Invalid register name 'edx'."], error=True
+            "register read edx", ["error: Invalid register name 'edx'"], error=True
         )
 
     @skipIfXmlSupportMissing
@@ -954,7 +954,7 @@ def haltReason(self):
         self.match("register read ecx", ["ecx = 0x14131211"])
         # dx should not be added
         self.match(
-            "register read cx", ["error: Invalid register name 'cx'."], error=True
+            "register read cx", ["error: Invalid register name 'cx'"], error=True
         )
 
     @skipIfXmlSupportMissing
@@ -1049,5 +1049,5 @@ def haltReason(self):
         self.match("register read x1", ["x1 = 0x1817161514131211"])
         # w1 should not be added
         self.match(
-            "register read w1", ["error: Invalid register name 'w1'."], error=True
+            "register read w1", ["error: Invalid register name 'w1'"], error=True
         )
diff --git a/lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py b/lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py
index 941a909aa93aa..d3210883482b8 100644
--- a/lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py
+++ b/lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py
@@ -32,4 +32,4 @@ def test_unknown_command(self):
 
         command_interpreter.HandleCommand("qbert", result)
         self.assertFalse(result.Succeeded())
-        self.assertEqual(result.GetError(), "error: 'qbert' is not a valid command.\n")
+        self.assertEqual(result.GetError(), "error: 'qbert' is not a valid command\n")
diff --git a/lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
index 01ed11a5a1121..cb25df3b11425 100644
--- a/lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -162,7 +162,7 @@ def test_get_transcript(self):
                 "command": "an-unknown-command",
                 # Unresolved commands don't have "commandName"/"commandArguments"
                 "output": "",
-                "error": "error: 'an-unknown-command' is not a valid command.\n",
+                "error": "error: 'an-unknown-command' is not a valid command\n",
             },
         )
 
diff --git a/lldb/test/Shell/Commands/list-header.test b/lldb/test/Shell/Commands/list-header.test
index 27eaa1a4f29c2..821af02faf3b0 100644
--- a/lldb/test/Shell/Commands/list-header.test
+++ b/lldb/test/Shell/Commands/list-header.test
@@ -24,7 +24,7 @@
 # CHECK-INLINED: 6   	  *ptr = x; // should crash here
 # CHECK-INLINED: 7   	}
 
-# CHECK-NO-INLINED: error: Could not find source file "foo.h".
+# CHECK-NO-INLINED: error: Could not find source file "foo.h"
 
 #--- foo.h
 // foo.h
diff --git a/lldb/test/Shell/Minidump/disassemble-no-module.yaml b/lldb/test/Shell/Minidump/disassemble-no-module.yaml
index 00c12c8b9ab93..19a4a4a16f92d 100644
--- a/lldb/test/Shell/Minidump/disassemble-no-module.yaml
+++ b/lldb/test/Shell/Minidump/disassemble-no-module.yaml
@@ -7,7 +7,7 @@
 # CHECK: frame #0: 0x0000000000400430
 # CHECK-LABEL: (lldb) disassemble
 # CHECK-NEXT: error: error reading data from section .module_image
-# CHECK-NEXT: error: Failed to disassemble memory at 0x00400430.
+# CHECK-NEXT: error: Failed to disassemble memory at 0x00400430
 
 --- !minidump
 Streams:         

``````````

</details>


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


More information about the lldb-commits mailing list