Index: clang-tools-extra/unittests/clang-tidy/CMakeLists.txt =================================================================== --- clang-tools-extra/unittests/clang-tidy/CMakeLists.txt +++ clang-tools-extra/unittests/clang-tidy/CMakeLists.txt @@ -16,7 +16,8 @@ ObjCModuleTest.cpp OverlappingReplacementsTest.cpp UsingInserterTest.cpp - ReadabilityModuleTest.cpp) + ReadabilityModuleTest.cpp + ) target_link_libraries(ClangTidyTests PRIVATE Index: llvm/utils/gn/build/sync_source_lists_from_cmake.py =================================================================== --- llvm/utils/gn/build/sync_source_lists_from_cmake.py +++ llvm/utils/gn/build/sync_source_lists_from_cmake.py @@ -61,6 +61,7 @@ # Matches e.g. |add_llvm_unittest_with_input_files|. unittest_re = re.compile(r'^add_\S+_unittest', re.MULTILINE) + # FIXME: Add 'clang-tools-extra'. checked = [ 'clang', 'lld', 'llvm' ] for c in checked: for root, _, _ in os.walk(os.path.join(c, 'unittests')): Index: llvm/utils/gn/secondary/clang-tools-extra/clangd/indexer/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/clang-tools-extra/clangd/indexer/BUILD.gn +++ llvm/utils/gn/secondary/clang-tools-extra/clangd/indexer/BUILD.gn @@ -10,7 +10,7 @@ "//clang/lib/Tooling", "//llvm/lib/Support", ] - include_dirs = [ "..", ] + include_dirs = [ ".." ] sources = [ "IndexerMain.cpp", ] Index: llvm/utils/gn/secondary/clang-tools-extra/test/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/clang-tools-extra/test/BUILD.gn +++ llvm/utils/gn/secondary/clang-tools-extra/test/BUILD.gn @@ -72,6 +72,7 @@ "//clang-tools-extra/clangd/tool:clangd", "//clang-tools-extra/modularize", "//clang-tools-extra/pp-trace", + "//clang-tools-extra/unittests", "//clang/lib/Headers", "//clang/tools/c-index-test", "//clang/tools/clang-rename", @@ -83,7 +84,6 @@ "//llvm/utils/not", ] - # FIXME: dep on "//clang-tools-extra/unittests" once it exists # FIXME: dep on dexp once it exist testonly = true } Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn @@ -0,0 +1,17 @@ +import("//clang/lib/StaticAnalyzer/Frontend/enable.gni") + +group("unittests") { + deps = [ + "clang-apply-replacements:ClangApplyReplacementsTests", + "clang-change-namespace:ClangChangeNamespaceTests", + "clang-doc:ClangDocTests", + "clang-include-fixer:ClangIncludeFixerTests", + "clang-include-fixer/find-all-symbols:FindAllSymbolsTests", + "clang-move:ClangMoveTests", + "clang-query:ClangQueryTests", + "clang-tidy:ClangTidyTests", + "clangd:ClangdTests", + ] + # FIXME: dep on clangd/xpc:ClangdXpcTests once it exists + testonly = true +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-apply-replacements/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-apply-replacements/BUILD.gn @@ -0,0 +1,15 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangApplyReplacementsTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-apply-replacements", + "//clang/lib/Basic", + "//clang/lib/Tooling/Core", + "//clang/lib/Tooling/Refactoring", + ] + include_dirs = [ "//clang-tools-extra/clang-apply-replacements/include" ] + sources = [ + "ApplyReplacementsTest.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-change-namespace/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-change-namespace/BUILD.gn @@ -0,0 +1,27 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangChangeNamespaceTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-change-namespace", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Frontend", + "//clang/lib/Rewrite", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//llvm/lib/Support", + ] + include_dirs = [ + "//clang-tools-extra/clang-change-namespace", + + # We'd like clang/unittests/Tooling/RewriterTestContext.h in the test. + "//clang", + ] + sources = [ + "ChangeNamespaceTests.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-doc/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-doc/BUILD.gn @@ -0,0 +1,29 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangDocTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-doc", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Frontend", + "//clang/lib/Rewrite", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/Support", + ] + include_dirs = [ "//clang-tools-extra/clang-doc" ] + sources = [ + "BitcodeTest.cpp", + "ClangDocTest.cpp", + "MDGeneratorTest.cpp", + "MergeTest.cpp", + "SerializeTest.cpp", + "YAMLGeneratorTest.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-include-fixer/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-include-fixer/BUILD.gn @@ -0,0 +1,27 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangIncludeFixerTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-include-fixer", + "//clang-tools-extra/clang-include-fixer/find-all-symbols", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Frontend", + "//clang/lib/Rewrite", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//llvm/lib/Support", + ] + include_dirs = [ + "//clang-tools-extra/clang-include-fixer", + + # We'd like clang/unittests/Tooling/RewriterTestContext.h in the test. + "//clang", + ] + sources = [ + "FuzzySymbolIndexTests.cpp", + "IncludeFixerTest.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-include-fixer/find-all-symbols/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-include-fixer/find-all-symbols/BUILD.gn @@ -0,0 +1,20 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("FindAllSymbolsTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-include-fixer/find-all-symbols", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/Basic", + "//clang/lib/Frontend", + "//clang/lib/Lex", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//llvm/lib/Support", + ] + include_dirs = [ "//clang-tools-extra/clang-include-fixer/find-all-symbols" ] + sources = [ + "FindAllSymbolsTests.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-move/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-move/BUILD.gn @@ -0,0 +1,27 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangMoveTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-move", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Frontend", + "//clang/lib/Rewrite", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//llvm/lib/Support", + ] + include_dirs = [ + "//clang-tools-extra/clang-move", + + # We'd like clang/unittests/Tooling/RewriterTestContext.h in the test. + "//clang", + ] + sources = [ + "ClangMoveTests.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-query/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-query/BUILD.gn @@ -0,0 +1,21 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangQueryTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-query", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/ASTMatchers/Dynamic", + "//clang/lib/Basic", + "//clang/lib/Frontend", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//llvm/lib/Support", + ] + include_dirs = [ "//clang-tools-extra/clang-query" ] + sources = [ + "QueryEngineTest.cpp", + "QueryParserTest.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn @@ -0,0 +1,36 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangTidyTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-tidy", + "//clang-tools-extra/clang-tidy/android", + "//clang-tools-extra/clang-tidy/google", + "//clang-tools-extra/clang-tidy/llvm", + "//clang-tools-extra/clang-tidy/objc", + "//clang-tools-extra/clang-tidy/readability", + "//clang-tools-extra/clang-tidy/utils", + "//clang/lib/AST", + "//clang/lib/ASTMatchers", + "//clang/lib/Basic", + "//clang/lib/Frontend", + "//clang/lib/Lex", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//llvm/lib/Support", + ] + include_dirs = [ "//clang-tools-extra/clang-tidy" ] + sources = [ + "ClangTidyDiagnosticConsumerTest.cpp", + "ClangTidyOptionsTest.cpp", + "GoogleModuleTest.cpp", + "IncludeInserterTest.cpp", + "LLVMModuleTest.cpp", + "NamespaceAliaserTest.cpp", + "ObjCModuleTest.cpp", + "OverlappingReplacementsTest.cpp", + "ReadabilityModuleTest.cpp", + "UsingInserterTest.cpp", + ] +} Index: llvm/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn @@ -0,0 +1,67 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ClangdTests") { + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang-tools-extra/clang-tidy", + "//clang-tools-extra/clangd", + "//clang-tools-extra/clangd/refactor/tweaks", + "//clang/lib/AST", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Frontend", + "//clang/lib/Index", + "//clang/lib/Lex", + "//clang/lib/Sema", + "//clang/lib/Serialization", + "//clang/lib/Tooling", + "//clang/lib/Tooling/Core", + "//clang/lib/Tooling/Inclusions", + "//llvm/lib/Support", + "//llvm/lib/Testing/Support", + ] + include_dirs = [ "//clang-tools-extra/clangd" ] + sources = [ + "Annotations.cpp", + "BackgroundIndexTests.cpp", + "CancellationTests.cpp", + "ClangdTests.cpp", + "ClangdUnitTests.cpp", + "CodeCompleteTests.cpp", + "CodeCompletionStringsTests.cpp", + "ContextTests.cpp", + "DexTests.cpp", + "DiagnosticsTests.cpp", + "DraftStoreTests.cpp", + "ExpectedTypeTest.cpp", + "FSTests.cpp", + "FileDistanceTests.cpp", + "FileIndexTests.cpp", + "FindSymbolsTests.cpp", + "FunctionTests.cpp", + "FuzzyMatchTests.cpp", + "GlobalCompilationDatabaseTests.cpp", + "HeadersTests.cpp", + "IndexActionTests.cpp", + "IndexTests.cpp", + "JSONTransportTests.cpp", + "QualityTests.cpp", + "RIFFTests.cpp", + "SelectionTests.cpp", + "SerializationTests.cpp", + "SourceCodeTests.cpp", + "SymbolCollectorTests.cpp", + "SymbolInfoTests.cpp", + "SyncAPI.cpp", + "TUSchedulerTests.cpp", + "TestFS.cpp", + "TestIndex.cpp", + "TestTU.cpp", + "ThreadingTests.cpp", + "TraceTests.cpp", + "TweakTests.cpp", + "TypeHierarchyTests.cpp", + "URITests.cpp", + "XRefsTests.cpp", + ] +}