[Lldb-commits] [lldb] r370638 - [lldb][NFC] Add test for source info

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 2 03:55:52 PDT 2019


Author: teemperor
Date: Mon Sep  2 03:55:52 2019
New Revision: 370638

URL: http://llvm.org/viewvc/llvm-project?rev=370638&view=rev
Log:
[lldb][NFC] Add test for source info

Added:
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/Makefile
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/main.cpp
    lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/second.cpp

Added: lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/Makefile?rev=370638&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/Makefile (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/Makefile Mon Sep  2 03:55:52 2019
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp second.cpp
+include $(LEVEL)/Makefile.rules

Added: lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py?rev=370638&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/TestSourceInfo.py Mon Sep  2 03:55:52 2019
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals())

Added: lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/main.cpp?rev=370638&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/main.cpp (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/main.cpp Mon Sep  2 03:55:52 2019
@@ -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"])
+}

Added: lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/second.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/second.cpp?rev=370638&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/second.cpp (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/commands/source/info/second.cpp Mon Sep  2 03:55:52 2019
@@ -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"])
+}




More information about the lldb-commits mailing list