Skip to content

[lldb] Fix failing test in TestClangREPL #154339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anutosh491
Copy link
Member

Addressing #153560

The test runs as expected now

anutosh491@Anutoshs-MacBook-Air lldb % ./bin/lldb-dotest -p TestClangREPL.py

/opt/homebrew/opt/[email protected]/bin/python3.13 /Users/anutosh491/work/llvm-project/lldb/test/API/dotest.py --arch arm64 -u CXXFLAGS -u CFLAGS --out-of-tree-debugserver --build-dir /Users/anutosh491/build/lldb/lldb-test-build.noindex --executable /Users/anutosh491/build/lldb/./bin/lldb --compiler /Users/anutosh491/build/lldb/./bin/clang --dsymutil /Users/anutosh491/build/lldb/./bin/dsymutil --make /usr/bin/make --lldb-libs-dir /Users/anutosh491/build/lldb/./lib --llvm-tools-dir /Users/anutosh491/build/lldb/./bin --libcxx-include-dir /Users/anutosh491/build/lldb/include/c++/v1 --libcxx-library-dir /Users/anutosh491/build/lldb/lib --lldb-obj-root /Users/anutosh491/build/lldb/tools/lldb --cmake-build-type Release -p TestClangREPL.py
lldb version 22.0.0git ([email protected]:anutosh491/llvm-project.git revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a)
  clang revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a
  llvm revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a
Skipping the following test categories: ['libstdcxx', 'msvcstl', 'dwo', 'llgs', 'fork']
PASS: LLDB (/Users/anutosh491/build/lldb/bin/clang-arm64) :: test_basic_completion (TestClangREPL.TestCase.test_basic_completion)
PASS: LLDB (/Users/anutosh491/build/lldb/bin/clang-arm64) :: test_completion_with_space_only_line (TestClangREPL.TestCase.test_completion_with_space_only_line)
----------------------------------------------------------------------
Ran 2 tests in 75.587s

OK

@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2025

@llvm/pr-subscribers-lldb

Author: Anutosh Bhat (anutosh491)

Changes

Addressing #153560

The test runs as expected now

anutosh491@<!-- -->Anutoshs-MacBook-Air lldb % ./bin/lldb-dotest -p TestClangREPL.py

/opt/homebrew/opt/python@<!-- -->3.13/bin/python3.13 /Users/anutosh491/work/llvm-project/lldb/test/API/dotest.py --arch arm64 -u CXXFLAGS -u CFLAGS --out-of-tree-debugserver --build-dir /Users/anutosh491/build/lldb/lldb-test-build.noindex --executable /Users/anutosh491/build/lldb/./bin/lldb --compiler /Users/anutosh491/build/lldb/./bin/clang --dsymutil /Users/anutosh491/build/lldb/./bin/dsymutil --make /usr/bin/make --lldb-libs-dir /Users/anutosh491/build/lldb/./lib --llvm-tools-dir /Users/anutosh491/build/lldb/./bin --libcxx-include-dir /Users/anutosh491/build/lldb/include/c++/v1 --libcxx-library-dir /Users/anutosh491/build/lldb/lib --lldb-obj-root /Users/anutosh491/build/lldb/tools/lldb --cmake-build-type Release -p TestClangREPL.py
lldb version 22.0.0git (git@<!-- -->github.com:anutosh491/llvm-project.git revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a)
  clang revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a
  llvm revision ab8b4f6629ee9c4c99c2751aa394f65ee2a4a34a
Skipping the following test categories: ['libstdcxx', 'msvcstl', 'dwo', 'llgs', 'fork']
PASS: LLDB (/Users/anutosh491/build/lldb/bin/clang-arm64) :: test_basic_completion (TestClangREPL.TestCase.test_basic_completion)
PASS: LLDB (/Users/anutosh491/build/lldb/bin/clang-arm64) :: test_completion_with_space_only_line (TestClangREPL.TestCase.test_completion_with_space_only_line)
----------------------------------------------------------------------
Ran 2 tests in 75.587s

OK

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

1 Files Affected:

  • (modified) lldb/test/API/repl/clang/TestClangREPL.py (+3-12)
diff --git a/lldb/test/API/repl/clang/TestClangREPL.py b/lldb/test/API/repl/clang/TestClangREPL.py
index 3152018865b1e..ffa598b650937 100644
--- a/lldb/test/API/repl/clang/TestClangREPL.py
+++ b/lldb/test/API/repl/clang/TestClangREPL.py
@@ -30,8 +30,9 @@ def start_repl(self):
         self.expect("b main", substrs=["Breakpoint 1", "address ="])
         self.expect("run", substrs=["stop reason = breakpoint 1"])
 
-        # Start the REPL.
-        self.child.send("expression --repl -l c --\n")
+        # Start the REPL with a harmless trailing input to trigger the warning.
+        self.child.send("expression --repl -l c -- 3 + 3\n")
+        self.child.expect_exact("Warning: trailing input is ignored in --repl mode")
         self.child.expect_exact("1>")
 
     # PExpect uses many timeouts internally and doesn't play well
@@ -56,16 +57,6 @@ def test_basic_completion(self):
 
         self.quit()
 
-        # Re-enter the REPL with trailing input to trigger warning.
-        self.child.send("expression --repl -l c -- 3 + 3\n")
-        self.child.expect_exact("Warning: trailing input is ignored in --repl mode\n")
-        self.child.expect_exact("1>")
-
-        # Evaluate another expression after warning.
-        self.expect_repl("4 + 4", substrs=["(int) $3 = 8"])
-
-        self.quit()
-
     # PExpect uses many timeouts internally and doesn't play well
     # under ASAN on a loaded machine..
     @skipIfAsan

@rastogishubham
Copy link
Contributor

Hi @anutosh491 just referencing my comment #153560 (comment)

Greendragon must always be green, to make sure we catch any issues that break the tests, I reverted the change in #153560 Please make sure you reland the change with your fix in this current patch (assuming it works) thanks!

@anutosh491
Copy link
Member Author

Thanks @rastogishubham . I've reapplied the patch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants