Skip to content

[lldb][test] Move std::ranges::ref_view from libcxx to generic directory #147705

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

Michael137
Copy link
Member

This just moves the test from libcxx to generic. There are currently no std::ranges::ref_view formatters for libstdc++ so I didn't add a test-case for it.

Split out from #146740

@Michael137 Michael137 requested a review from labath July 9, 2025 11:38
@Michael137 Michael137 requested a review from JDevlieghere as a code owner July 9, 2025 11:38
@llvmbot llvmbot added the lldb label Jul 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2025

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

This just moves the test from libcxx to generic. There are currently no std::ranges::ref_view formatters for libstdc++ so I didn't add a test-case for it.

Split out from #146740


Full diff: https://github.com/llvm/llvm-project/pull/147705.diff

3 Files Affected:

  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile (-2)
  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py (+9-5)
  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/main.cpp ()
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile
similarity index 82%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile
index 3c4f9b45f41de..4f79c0a900c3a 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile
@@ -1,5 +1,3 @@
-USE_LIBCPP := 1
-
 CXX_SOURCES := main.cpp
 CXXFLAGS_EXTRAS := -std=c++20
 
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py
similarity index 92%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py
index 9b5194be91e78..f135da70c7b47 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py
@@ -8,7 +8,7 @@
 from lldbsuite.test import lldbutil
 
 
-class LibcxxRangesRefViewDataFormatterTestCase(TestBase):
+class StdRangesRefViewDataFormatterTestCase(TestBase):
     def check_string_vec_children(self):
         return [
             ValueCheck(name="[0]", summary='"First"'),
@@ -27,10 +27,7 @@ def check_string_vec_ref_view(self):
     def check_foo(self):
         return ValueCheck(name="vec", children=self.check_string_vec_children())
 
-    @add_test_categories(["libc++"])
-    @skipIf(compiler=no_match("clang"))
-    @skipIf(compiler="clang", compiler_version=["<", "16.0"])
-    def test_with_run_command(self):
+    def do_test(self):
         """Test that std::ranges::ref_view is formatted correctly when printed."""
         self.build()
         (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
@@ -69,3 +66,10 @@ def test_with_run_command(self):
                 )
             ],
         )
+
+    @skipIf(compiler=no_match("clang"))
+    @skipIf(compiler="clang", compiler_version=["<", "16.0"])
+    @add_test_categories(["libc++"])
+    def test_libcxx(self):
+        self.build(dictionary={"USE_LIBCPP": 1})
+        self.do_test()
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/main.cpp
similarity index 100%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/main.cpp
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/main.cpp

This just moves the test from `libcxx` to `generic`. There are currently no `std::ranges::ref_view` formatters for libstdc++ so I didn't add a test-case for it.

Split out from llvm#146740
@Michael137 Michael137 merged commit fa80a1a into llvm:main Jul 9, 2025
11 checks passed
@Michael137 Michael137 deleted the lldb/consolidate-stl-tests-ranges branch July 9, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants