[lldb] Standardize TestVectorOfEnums.py as a C++ data formatter test (#189757)

This is explicitly marked as a libc++ test and functionally tests the
formatter for a vector of enums. I put it in the generic directory
because there's no reason this couldn't work for other c++ stdlibs.

Additionally, this should be using the custom libc++ like the other
tests.
This commit is contained in:
Alex Langford 2026-04-02 11:12:00 -07:00 committed by GitHub
parent d0e265f20d
commit 343210656c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 8 deletions

View File

@ -3,7 +3,6 @@ Test Expression Parser regression test to ensure that we handle enums
correctly, in this case specifically std::vector of enums.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@ -11,9 +10,11 @@ from lldbsuite.test import lldbutil
class TestVectorOfEnums(TestBase):
SHARED_BUILD_TESTCASE = False
@add_test_categories(["libc++"])
def test_vector_of_enums(self):
self.build()
self.build(dictionary={"USE_LIBCPP": 1})
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.cpp", False)

View File

@ -1,11 +1,6 @@
#include <vector>
enum E {
a,
b,
c,
d
} ;
enum E { a, b, c, d };
int main() {
std::vector<E> v = {E::a, E::b, E::c};