[Testing] Drop clangTesting from clang's public library interface

This was probably not particularly intended to be public, and disallows deps
on gtest which are useful in test helpers.

https://discourse.llvm.org/t/stop-exporting-clangtesting-library/61672

Differential Revision: https://reviews.llvm.org/D123610
This commit is contained in:
Sam McCall 2022-04-12 16:27:11 +02:00
parent 1dfe0273fd
commit 4cec789c17
10 changed files with 27 additions and 10 deletions

View File

@ -25,5 +25,7 @@ add_subdirectory(Index)
add_subdirectory(IndexSerialization)
add_subdirectory(StaticAnalyzer)
add_subdirectory(Format)
add_subdirectory(Testing)
if(CLANG_INCLUDE_TESTS)
add_subdirectory(Testing)
endif()
add_subdirectory(Interpreter)

View File

@ -2,6 +2,13 @@ set(LLVM_LINK_COMPONENTS
Support
)
add_clang_library(clangTesting
# Not add_clang_library: this is not part of clang's public library interface.
# Unit tests should depend on this with target_link_libraries(), rather
# than with clang_target_link_libraries().
add_llvm_library(clangTesting
CommandLineArgs.cpp
BUILDTREE_ONLY
LINK_COMPONENTS
Support
)

View File

@ -43,11 +43,11 @@ clang_target_link_libraries(ASTTests
clangFrontend
clangLex
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(ASTTests
PRIVATE
clangTesting
LLVMTestingSupport
)

View File

@ -18,12 +18,12 @@ clang_target_link_libraries(ASTMatchersTests
clangBasic
clangFrontend
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(ASTMatchersTests
PRIVATE
clangTesting
LLVMTestingSupport
)

View File

@ -17,6 +17,10 @@ clang_target_link_libraries(DynamicASTMatchersTests
clangDynamicASTMatchers
clangFrontend
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(DynamicASTMatchersTests
PRIVATE
clangTesting
)

View File

@ -20,12 +20,12 @@ clang_target_link_libraries(ClangAnalysisTests
clangFrontend
clangLex
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(ClangAnalysisTests
PRIVATE
clangTesting
LLVMTestingSupport
)

View File

@ -31,11 +31,11 @@ clang_target_link_libraries(ClangAnalysisFlowSensitiveTests
clangFrontend
clangLex
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(ClangAnalysisFlowSensitiveTests
PRIVATE
clangTesting
LLVMTestingSupport
)

View File

@ -19,11 +19,11 @@ clang_target_link_libraries(SemaTests
clangParse
clangSema
clangSerialization
clangTesting
clangTooling
)
target_link_libraries(SemaTests
PRIVATE
clangTesting
LLVMTestingSupport
)

View File

@ -31,6 +31,10 @@ clang_target_link_libraries(StaticAnalysisTests
clangSerialization
clangStaticAnalyzerCore
clangStaticAnalyzerFrontend
clangTesting
clangTooling
)
target_link_libraries(StaticAnalysisTests
PRIVATE
clangTesting
)

View File

@ -18,7 +18,6 @@ clang_target_link_libraries(SyntaxTests
clangFrontend
clangLex
clangSerialization
clangTesting
clangTooling
clangToolingCore
clangToolingSyntax
@ -26,5 +25,6 @@ clang_target_link_libraries(SyntaxTests
target_link_libraries(SyntaxTests
PRIVATE
clangTesting
LLVMTestingSupport
)