https://github.com/Michael137 created
https://github.com/llvm/llvm-project/pull/181128
This test was failing locally for me because I command script import statements
in my `~/.lldibinit` which print to `stdout`. E.g.,:
```
Traceback (most recent call last):
File
"/Users/michaelbuch/Git/llvm-worktrees/main/lldb/test/API/driver/batch_mode/TestBatchMode.py",
line 33, in test_batch_mode_no_commands_quits
self.assertEqual(proc.stdout, "")
AssertionError: 'The "bt" python commands have been instal[326 chars]p.\n' != ''
- The "bt" python commands have been installed and are ready for use.
- The "sd" python command has been installed and is ready for use.
- The "expr" python aliases have been installed and are ready for use.
- "malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs"
commands have been installed, use the "--help" options on these commands for
detailed help.
```
I guess we could have a separate test for `--batch` with a test-local
`.lldibinit` that confirms we actually load the lldbinit before quitting. Not
sure how much value that would be. For now I just added the `--no-lldbinit` to
the test
>From 42480216c4f1a94df9df079319586b272b66ea55 Mon Sep 17 00:00:00 2001
From: Michael Buch <[email protected]>
Date: Thu, 12 Feb 2026 12:21:42 +0000
Subject: [PATCH] [lldb][test] TestBatchMode.py: don't load lldbinit in --batch
test
This test was failing locally for me because I command script import
statements in my `~/.lldibinit` which print to `stdout`. E.g.,:
```
Traceback (most recent call last):
File
"/Users/michaelbuch/Git/llvm-worktrees/main/lldb/test/API/driver/batch_mode/TestBatchMode.py",
line 33, in test_batch_mode_no_commands_quits
self.assertEqual(proc.stdout, "")
AssertionError: 'The "bt" python commands have been instal[326 chars]p.\n' != ''
- The "bt" python commands have been installed and are ready for use.
- The "sd" python command has been installed and is ready for use.
- The "expr" python aliases have been installed and are ready for use.
- "malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs"
commands have been installed, use the "--help" options on these commands for
detailed help.
```
I guess we could have a separate test for `--batch` with a test-local
`.lldibinit` that confirms we actually load the lldbinit before quitting. Not
sure how much value that would be. For now I just added the `--no-lldbinit` to
the test
---
lldb/test/API/driver/batch_mode/TestBatchMode.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/test/API/driver/batch_mode/TestBatchMode.py
b/lldb/test/API/driver/batch_mode/TestBatchMode.py
index aca4b7e5e6423..aa03918cd7b2b 100644
--- a/lldb/test/API/driver/batch_mode/TestBatchMode.py
+++ b/lldb/test/API/driver/batch_mode/TestBatchMode.py
@@ -19,7 +19,7 @@ def test_batch_mode_no_commands_quits(self):
"""--batch should immediately quit if there are no commands given."""
try:
proc = subprocess.run(
- [lldbtest_config.lldbExec, "--batch"],
+ [lldbtest_config.lldbExec, "--batch", "--no-lldbinit"],
timeout=60,
stdout=subprocess.PIPE,
text=True,
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits