summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
commit061da546b983eb767bad15e67af1174fb0bcf31c (patch)
tree83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion
parentImport LLVM 10.0.0 release including clang, lld and lldb. (diff)
downloadwireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.tar.xz
wireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.zip
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom tested by plenty
Diffstat (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion')
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/Makefile2
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/TestMultilineCompletion.py35
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/main.c4
3 files changed, 41 insertions, 0 deletions
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/Makefile b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/Makefile
new file mode 100644
index 00000000000..c9319d6e688
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/Makefile
@@ -0,0 +1,2 @@
+C_SOURCES := main.c
+include Makefile.rules
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/TestMultilineCompletion.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/TestMultilineCompletion.py
new file mode 100644
index 00000000000..9b2b71230e5
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/TestMultilineCompletion.py
@@ -0,0 +1,35 @@
+"""
+Test completion for multiline expressions.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.lldbpexpect import PExpectTest
+
+class MultilineCompletionTest(PExpectTest):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ # PExpect uses many timeouts internally and doesn't play well
+ # under ASAN on a loaded machine..
+ @skipIfAsan
+ @skipIfRemote # test is written to explicitly "run" the binary
+ @skipIfEditlineSupportMissing
+ def test_basic_completion(self):
+ """Test that we can complete a simple multiline expression"""
+ self.build()
+
+ self.launch(executable=self.getBuildArtifact("a.out"), dimensions=(100,500))
+ self.expect("b main", substrs=["Breakpoint 1", "address ="])
+ self.expect("run", substrs=["stop reason ="])
+
+ self.child.sendline("expr")
+ self.child.expect_exact("terminate with an empty line to evaluate")
+ self.child.send("to_\t")
+ self.child.expect_exact("to_complete")
+
+ self.child.send("\n\n")
+ self.expect_prompt()
+
+ self.quit()
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/main.c b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/main.c
new file mode 100644
index 00000000000..6dd3616c1ae
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/commands/expression/multiline-completion/main.c
@@ -0,0 +1,4 @@
+int main(int argc, char **argv) {
+ int to_complete = 0;
+ return to_complete;
+}