Skip to content

Commit b7d4735

Browse files
authored
[lldb][test] Combine libstdc++ and libc++ vector<bool> tests into generic test (#147137)
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_DEBUG` case 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
1 parent d8ef156 commit b7d4735

File tree

7 files changed

+85
-225
lines changed

7 files changed

+85
-225
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
CXX_SOURCES := main.cpp
2-
USE_LIBCPP := 1
2+
33
include Makefile.rules
44

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Test lldb data formatter subsystem.
33
"""
44

5-
6-
from typing import Optional
75
import lldb
86
from lldbsuite.test.decorators import *
97
from lldbsuite.test.lldbtest import *
@@ -17,19 +15,8 @@ def setUp(self):
1715
# Find the line number to break at.
1816
self.line = line_number("main.cpp", "// Set break point at this line.")
1917

20-
@skip
21-
@add_test_categories(["libstdcxx"])
22-
def test_with_run_command(self):
23-
self.with_run_command()
24-
25-
@add_test_categories(["libstdcxx"])
26-
def test_with_run_command_debug(self):
27-
build_args = {"CXXFLAGS_EXTRAS": "-D_GLIBCXX_DEBUG"}
28-
self.with_run_command(build_args)
29-
30-
def with_run_command(self, dictionary: Optional[dict] = None):
18+
def do_test(self):
3119
"""Test that that file and class static variables display correctly."""
32-
self.build(dictionary=dictionary)
3320
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
3421

3522
lldbutil.run_break_set_by_file_and_line(
@@ -52,6 +39,7 @@ def cleanup():
5239
self.runCmd("type summary clear", check=False)
5340
self.runCmd("type filter clear", check=False)
5441
self.runCmd("type synth clear", check=False)
42+
self.runCmd("settings set target.max-children-count 24", check=False)
5543

5644
# Execute the cleanup function during test case tear down.
5745
self.addTearDownHook(cleanup)
@@ -83,3 +71,20 @@ def cleanup():
8371
"[48] = true",
8472
],
8573
)
74+
75+
@add_test_categories(["libc++"])
76+
def test_libcxx(self):
77+
self.build(dictionary={"USE_LIBCPP": 1})
78+
self.do_test()
79+
80+
@add_test_categories(["libstdcxx"])
81+
def test_libstdcxx(self):
82+
self.build(dictionary={"USE_LIBSTDCPP": 1})
83+
self.do_test()
84+
85+
@add_test_categories(["libstdcxx"])
86+
def test_libstdcxx_debug(self):
87+
self.build(
88+
dictionary={"USE_LIBSTDCPP": 1, "CXXFLAGS_EXTRAS": "-D_GLIBCXX_DEBUG"}
89+
)
90+
self.do_test()
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#include <cstdio>
2+
#include <string>
3+
#include <vector>
4+
5+
int main() {
6+
std::vector<bool> vBool;
7+
8+
vBool.push_back(false);
9+
vBool.push_back(true);
10+
vBool.push_back(false);
11+
vBool.push_back(true);
12+
vBool.push_back(false);
13+
vBool.push_back(true);
14+
vBool.push_back(false);
15+
vBool.push_back(true);
16+
17+
vBool.push_back(false);
18+
vBool.push_back(true);
19+
vBool.push_back(false);
20+
vBool.push_back(true);
21+
vBool.push_back(false);
22+
vBool.push_back(true);
23+
vBool.push_back(false);
24+
vBool.push_back(true);
25+
26+
vBool.push_back(false);
27+
vBool.push_back(true);
28+
vBool.push_back(false);
29+
vBool.push_back(true);
30+
vBool.push_back(false);
31+
vBool.push_back(true);
32+
vBool.push_back(false);
33+
vBool.push_back(true);
34+
35+
vBool.push_back(false);
36+
vBool.push_back(true);
37+
vBool.push_back(false);
38+
vBool.push_back(true);
39+
vBool.push_back(false);
40+
vBool.push_back(true);
41+
vBool.push_back(false);
42+
vBool.push_back(true);
43+
44+
vBool.push_back(false);
45+
vBool.push_back(true);
46+
vBool.push_back(false);
47+
vBool.push_back(true);
48+
vBool.push_back(false);
49+
vBool.push_back(true);
50+
vBool.push_back(false);
51+
vBool.push_back(true);
52+
53+
vBool.push_back(false);
54+
vBool.push_back(true);
55+
vBool.push_back(false);
56+
vBool.push_back(true);
57+
vBool.push_back(false);
58+
vBool.push_back(true);
59+
vBool.push_back(false);
60+
vBool.push_back(true);
61+
vBool.push_back(true);
62+
63+
std::puts("// Set break point at this line.");
64+
return 0;
65+
}

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp

Lines changed: 0 additions & 65 deletions
This file was deleted.

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/Makefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/main.cpp

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)