-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[lldb][test] Combine libstdc++ and libc++ vector<bool> tests into generic test #147137
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
[lldb][test] Combine libstdc++ and libc++ vector<bool> tests into generic test #147137
Conversation
|
@llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) ChangesThe libc++ and libstdc++ tests were pretty much an exact copy of each other. This test moves the libc++ test into generic removes it from libstdc++. I moved the Split out from #146740 Full diff: https://github.com/llvm/llvm-project/pull/147137.diff 7 Files Affected:
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/Makefile b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/Makefile
similarity index 75%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/Makefile
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/Makefile
index d87cf7d402787..65e9dd2fa9e33 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/Makefile
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/Makefile
@@ -1,4 +1,4 @@
CXX_SOURCES := main.cpp
-USE_LIBCPP := 1
+
include Makefile.rules
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/TestDataFormatterStdVBool.py
similarity index 80%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/TestDataFormatterStdVBool.py
index f3371bc014b17..5d2b3f2cabf15 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/TestDataFormatterStdVBool.py
@@ -3,7 +3,6 @@
"""
-from typing import Optional
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@@ -17,19 +16,8 @@ def setUp(self):
# Find the line number to break at.
self.line = line_number("main.cpp", "// Set break point at this line.")
- @skip
- @add_test_categories(["libstdcxx"])
- def test_with_run_command(self):
- self.with_run_command()
-
- @add_test_categories(["libstdcxx"])
- def test_with_run_command_debug(self):
- build_args = {"CXXFLAGS_EXTRAS": "-D_GLIBCXX_DEBUG"}
- self.with_run_command(build_args)
-
- def with_run_command(self, dictionary: Optional[dict] = None):
+ def do_test(self):
"""Test that that file and class static variables display correctly."""
- self.build(dictionary=dictionary)
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
@@ -52,6 +40,7 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
+ self.runCmd("settings set target.max-children-count 24", check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -83,3 +72,19 @@ def cleanup():
"[48] = true",
],
)
+
+ @add_test_categories(["libc++"])
+ def test_libcxx(self):
+ self.build(dictionary={"USE_LIBCPP" : 1})
+ self.do_test()
+
+ @add_test_categories(["libstdcxx"])
+ def test_libstdcxx(self):
+ self.build(dictionary={"USE_LIBSTDCPP" : 1})
+ self.do_test()
+
+ @add_test_categories(["libstdcxx"])
+ def test_libstdcxx_debug(self):
+ self.build(dictionary={"USE_LIBSTDCPP" : 1,
+ "CXXFLAGS_EXTRAS": "-D_GLIBCXX_DEBUG"})
+ self.do_test()
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/main.cpp
new file mode 100644
index 0000000000000..22fc6c89ca8a2
--- /dev/null
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/main.cpp
@@ -0,0 +1,65 @@
+#include <cstdio>
+#include <string>
+#include <vector>
+
+int main() {
+ std::vector<bool> vBool;
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(false);
+ vBool.push_back(true);
+ vBool.push_back(true);
+
+ std::puts("// Set break point at this line.");
+ return 0;
+}
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
deleted file mode 100644
index 24dddee62e1e7..0000000000000
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ /dev/null
@@ -1,76 +0,0 @@
-"""
-Test lldb data formatter subsystem.
-"""
-
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class LibcxxVBoolDataFormatterTestCase(TestBase):
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
- # Find the line number to break at.
- self.line = line_number("main.cpp", "// Set break point at this line.")
-
- @add_test_categories(["libc++"])
- def test_with_run_command(self):
- """Test that that file and class static variables display correctly."""
- self.build()
- self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
-
- lldbutil.run_break_set_by_file_and_line(
- self, "main.cpp", self.line, num_expected_locations=-1
- )
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- # The stop reason of the thread should be breakpoint.
- self.expect(
- "thread list",
- STOPPED_DUE_TO_BREAKPOINT,
- substrs=["stopped", "stop reason = breakpoint"],
- )
-
- # This is the function to remove the custom formats in order to have a
- # clean slate for the next test case.
- def cleanup():
- self.runCmd("type format clear", check=False)
- self.runCmd("type summary clear", check=False)
- self.runCmd("type filter clear", check=False)
- self.runCmd("type synth clear", check=False)
- self.runCmd("settings set target.max-children-count 24", check=False)
-
- # Execute the cleanup function during test case tear down.
- self.addTearDownHook(cleanup)
-
- self.expect(
- "frame variable -A vBool",
- substrs=[
- "size=49",
- "[0] = false",
- "[1] = true",
- "[18] = false",
- "[27] = true",
- "[36] = false",
- "[47] = true",
- "[48] = true",
- ],
- )
-
- self.expect(
- "expr -A -- vBool",
- substrs=[
- "size=49",
- "[0] = false",
- "[1] = true",
- "[18] = false",
- "[27] = true",
- "[36] = false",
- "[47] = true",
- "[48] = true",
- ],
- )
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp
deleted file mode 100644
index 026cfc863f2c0..0000000000000
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <string>
-#include <vector>
-
-int main()
-{
- std::vector<bool> vBool;
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(true);
-
- printf ("size: %d", (int) vBool.size()); // Set break point at this line.
- return 0;
-}
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/Makefile b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/Makefile
deleted file mode 100644
index c825977b1a5dc..0000000000000
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-CXX_SOURCES := main.cpp
-
-CFLAGS_EXTRAS := -O0
-USE_LIBSTDCPP := 1
-
-include Makefile.rules
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/main.cpp
deleted file mode 100644
index 73956dd3fda31..0000000000000
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <vector>
-
-int main()
-{
- std::vector<bool> vBool;
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
-
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(false);
- vBool.push_back(true);
- vBool.push_back(true);
-
- return 0; // Set break point at this line.
-}
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/18909 Here is the relevant piece of the build log for the reference |
The libc++ and libstdc++ tests were pretty much an exact copy of each other. This test moves the libc++ test into generic removes it from libstdc++. I moved the
GLIBCXX_DEBUGcase over from libstdcxx. For some reason the libstdcxx test was skipped, but it passes on my Linux machine. So I unskipped it for now.Split out from #146740