diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-02 10:55:52 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-02 10:55:52 +0000 |
commit | 1aab62762f6658a6955d9bed719a345702f2bb56 (patch) | |
tree | 39b4d4df7f9d872342b3740b1e4c9c3230193b68 /lldb/packages/Python/lldbsuite/test/commands/source | |
parent | 05a3a9275144569af46c178523557be08ab06c2e (diff) | |
download | bcm5719-llvm-1aab62762f6658a6955d9bed719a345702f2bb56.tar.gz bcm5719-llvm-1aab62762f6658a6955d9bed719a345702f2bb56.zip |
[lldb][NFC] Add test for source info
llvm-svn: 370638
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands/source')
4 files changed, 26 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/source/info/Makefile b/lldb/packages/Python/lldbsuite/test/commands/source/info/Makefile new file mode 100644 index 00000000000..faf0ed5765f --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/source/info/Makefile @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp second.cpp +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py b/lldb/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py new file mode 100644 index 00000000000..c8308c16011 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals()) diff --git a/lldb/packages/Python/lldbsuite/test/commands/source/info/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/source/info/main.cpp new file mode 100644 index 00000000000..7d714900418 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/source/info/main.cpp @@ -0,0 +1,14 @@ +int bar(); + +int foo() { + return 3; +} + +int main() { + int f = foo() + bar(); + f++; + return f; //%self.expect("source info", substrs=["Lines found in module ", "main.cpp:10"]) + //%self.expect("source info -f main.cpp -c 10", matching=True, substrs=["main.cpp:10"]) + //%self.expect("source info -f main.cpp -c 1", matching=False, substrs=["main.cpp:10"]) + //%self.expect("source info -f main.cpp -l 10", matching=False, substrs=["main.cpp:7"]) +} diff --git a/lldb/packages/Python/lldbsuite/test/commands/source/info/second.cpp b/lldb/packages/Python/lldbsuite/test/commands/source/info/second.cpp new file mode 100644 index 00000000000..0e068a691a8 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/source/info/second.cpp @@ -0,0 +1,5 @@ +int bar() { + int i = 3; //%self.expect("source info", substrs=["Lines found in module ", "second.cpp:2"]) + return i; //%self.expect("source info", substrs=["Lines found in module ", "second.cpp:3"]) + //%self.expect("source info --name main", substrs=["Lines found in module ", "main.cpp:7", "main.cpp:10"]) +} |