Skip to content

[lldb][test] Turn std::chrono libcxx test generic #146873

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 2 commits into from
Jul 3, 2025

Conversation

Michael137
Copy link
Member

Split out from #146740

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

llvmbot commented Jul 3, 2025

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

Split out from #146740


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

3 Files Affected:

  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/Makefile (+1-3)
  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/TestDataFormatterStdChrono.py (+8-5)
  • (renamed) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/main.cpp ()
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/Makefile b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/Makefile
similarity index 82%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/Makefile
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/Makefile
index 57540fc1a2816..4f79c0a900c3a 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/Makefile
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/Makefile
@@ -1,6 +1,4 @@
 CXX_SOURCES := main.cpp
-
-USE_LIBCPP := 1
-
 CXXFLAGS_EXTRAS := -std=c++20
+
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/TestDataFormatterLibcxxChrono.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/TestDataFormatterStdChrono.py
similarity index 98%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/TestDataFormatterLibcxxChrono.py
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/TestDataFormatterStdChrono.py
index 0737a5bc7e6eb..4952eb3ae8464 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/TestDataFormatterLibcxxChrono.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/TestDataFormatterStdChrono.py
@@ -9,13 +9,10 @@
 from lldbsuite.test import lldbutil
 
 
-class LibcxxChronoDataFormatterTestCase(TestBase):
-    @add_test_categories(["libc++"])
-    @skipIf(compiler="clang", compiler_version=["<", "17.0"])
-    def test_with_run_command(self):
+class StdChronoDataFormatterTestCase(TestBase):
+    def do_test(self):
         """Test that that file and class static variables display correctly."""
         isNotWindowsHost = lldbplatformutil.getHostPlatform() != "windows"
-        self.build()
         (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
             self, "break here", lldb.SBFileSpec("main.cpp", False)
         )
@@ -433,3 +430,9 @@ def test_with_run_command(self):
                 "ymwdl_2024_last_tuesday_january = year=2024 month=January weekday=Tuesday index=last"
             ],
         )
+
+    @skipIf(compiler="clang", compiler_version=["<", "17.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/chrono/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/main.cpp
similarity index 100%
rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/chrono/main.cpp
rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/chrono/main.cpp

Copy link

github-actions bot commented Jul 3, 2025

✅ With the latest revision this PR passed the Python code formatter.

@Michael137 Michael137 merged commit 10dc4e1 into llvm:main Jul 3, 2025
9 checks passed
@Michael137 Michael137 deleted the lldb/consolidate-stl-tests-chrono branch July 3, 2025 14: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