Skip to content

Commit 366fb53

Browse files
committed
[lldb] Fix missing dependency on libc++ from LLDB test suite on non-Darwin platforms
Right now we only set a dependency on libc++ when the host is Darwin, which means that libc++ in the build directory is in some undefined state when running the test suite (it can be fully built, out-of-date or missing). Depending on whether we have a system libc++ (which LLDB also supports running the libc++ tests against), the outcome is that we sometimes skip the libc++ tests or we run the tests against a mix of ToT-libc++/system-libc++ (e.g., we compile against the ToT-libc++ headers and link against the system libc++ library). This can be demonstrated via `export LIT_FILTER=TestDataFormatterLibcxxSet ninja check-lldb-api` (or any other libc++ test) and then gradually building parts of libc++ in the same build (which will slowly change the test behaviour from `UNSUPPORTED` to various failures to passing depending on how much of libcxx is built at test time). Note that this effectively re-enables the (unintentionally) disabled libc++ formatter tests on Linux. Don't revert this if it breaks a libc++ LLDB test, instead please @skipIf decorate the failing test (as it was probably already failing before this commit). Reviewed By: labath Differential Revision: https://reviews.llvm.org/D111981
1 parent ee7ca88 commit 366fb53

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lldb/test/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,16 @@ if(TARGET clang)
135135
"`LLDB_INCLUDE_TESTS=OFF`.")
136136
endif()
137137
endif()
138-
add_lldb_test_dependency(cxx)
139138
endif()
140139
endif()
140+
141+
# Add libc++ dependency for libc++-specific tests. This is an optional
142+
# dependency as it's also possible to run the libc++ tests against the libc++
143+
# installed on the system.
144+
if (TARGET cxx)
145+
add_lldb_test_dependency(cxx)
146+
endif()
147+
141148
endif()
142149

143150
if (LLDB_BUILT_STANDALONE)

0 commit comments

Comments
 (0)