[Lldb-commits] [lldb] [lldb] Add actionable feedback when overwriting a command fails (PR #76030)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 20 01:50:01 PST 2023


================
@@ -161,6 +161,17 @@ def cleanup():
         )
         self.expect("my_command", substrs=["a.out"])
 
+        # Test that without --overwrite we are not allowed to redefine the command.
+        self.expect(
+            "command script add my_command --class welcome.TargetnameCommand",
+            substrs=[
+                "cannot add command: user command exists and force replace not set",
+                "--overwrite",
+                "settings set interpreter.require-overwrite false",
----------------
DavidSpickett wrote:

You could just check for the start of it if you're trying to save being verbose here. There's only one place the error message is generated, so if we have the start we have the end.

Or just check for the whole thing, it's not much more effort. If you want to be sure anyone updating the message later knows that this test exists and maybe needs updating.

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


More information about the lldb-commits mailing list