Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions utils/bazel/llvm-project-overlay/clang/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,29 @@ cc_library(
],
)

cc_library(
name = "directory_watcher",
srcs = glob([
"lib/DirectoryWatcher/*.cpp",
"lib/DirectoryWatcher/*.h",
]) + select({
"@platforms//os:windows": glob(["lib/DirectoryWatcher/windows/*.cpp"]),
"@platforms//os:macos": glob(["lib/DirectoryWatcher/mac/*.cpp"]),
"@platforms//os:linux": glob(["lib/DirectoryWatcher/linux/*.cpp"]),
"//conditions:default": glob(["lib/DirectoryWatcher/default/*.cpp"]),
}),
hdrs = glob([
"include/clang/DirectoryWatcher/*.h",
]),
includes = [
"include",
"lib/DirectoryWatcher",
],
deps = [
"//llvm:Support",
],
)

cc_library(
name = "install_api",
srcs = glob([
Expand Down
277 changes: 245 additions & 32 deletions utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

package(
default_visibility = ["//visibility:public"],
)
package(default_visibility = ["//visibility:public"])

licenses(["notice"])

Expand Down Expand Up @@ -96,6 +94,37 @@ cc_test(
],
)

cc_library(
name = "dataflow_testing_support",
testonly = 1,
srcs = ["Analysis/FlowSensitive/TestingSupport.cpp"],
hdrs = ["Analysis/FlowSensitive/TestingSupport.h"],
deps = [
"//clang:analysis",
"//clang:ast",
"//clang:ast_matchers",
"//clang:basic",
"//clang:lex",
"//clang:serialization",
"//clang:tooling",
"//llvm:Support",
"//llvm:TestingAnnotations",
"//third-party/unittest:gtest",
],
)

cc_library(
name = "dataflow_solver_test",
testonly = 1,
hdrs = ["Analysis/FlowSensitive/SolverTest.h"],
deps = [
":dataflow_testing_support",
"//clang:analysis",
"//third-party/unittest:gmock",
"//third-party/unittest:gtest",
],
)

cc_test(
name = "analysis_tests",
size = "small",
Expand Down Expand Up @@ -205,18 +234,17 @@ cc_test(
[
"Format/*.cpp",
"Format/*.h",
"Tooling/*.h",
],
allow_empty = False,
),
copts = ["$(STACK_FRAME_UNLIMITED)"],
features = ["-layering_check"], # #include "../../lib/Format/TokenAnalyzer.h"
shard_count = 20,
deps = [
":tooling_tests_hdrs",
"//clang:basic",
"//clang:format",
"//clang:frontend",
"//clang:rewrite",
"//clang:tooling_core",
"//llvm:Support",
"//third-party/unittest:gmock",
Expand Down Expand Up @@ -280,28 +308,6 @@ cc_test(
],
)

# A library to carefully expose the tooling headers using the include prefix
# expected by the `rename_tests`.
cc_library(
name = "rename_tests_tooling_hdrs",
testonly = 1,
hdrs = glob(
["Tooling/*.h"],
allow_empty = False,
),
include_prefix = "unittests",
deps = [
"//clang:ast",
"//clang:basic",
"//clang:frontend",
"//clang:rewrite",
"//clang:tooling",
"//clang:tooling_core",
"//llvm:Support",
"//third-party/unittest:gtest",
],
)

cc_test(
name = "rewrite_tests",
size = "small",
Expand Down Expand Up @@ -349,12 +355,12 @@ cc_library(
allow_empty = False,
),
deps = [
"//clang:analysis",
"//clang:ast_matchers",
"//clang:crosstu",
"//clang:frontend",
"//clang:static_analyzer_core",
"//clang:static_analyzer_frontend",
"//clang:testing",
"//clang:tooling",
"//third-party/unittest:gtest",
],
Expand Down Expand Up @@ -389,18 +395,35 @@ cc_test(
],
)

cc_library(
name = "tooling_tests_hdrs",
testonly = 1,
hdrs = glob(
["Tooling/*.h"],
allow_empty = False,
),
deps = [
"//clang:ast",
"//clang:basic",
"//clang:frontend",
"//clang:rewrite",
"//clang:tooling",
"//clang:tooling_core",
"//llvm:Support",
"//third-party/unittest:gtest",
],
)

cc_test(
name = "tooling_tests",
size = "medium",
srcs = glob(
[
"Tooling/*.cpp",
"Tooling/*.h",
],
["Tooling/*.cpp"],
allow_empty = False,
),
shard_count = 20,
deps = [
":tooling_tests_hdrs",
"//clang:ast",
"//clang:ast_matchers",
"//clang:basic",
Expand Down Expand Up @@ -528,3 +551,193 @@ cc_test(
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "crosstu_tests",
size = "small",
srcs = glob(
["CrossTU/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:ast",
"//clang:crosstu",
"//clang:frontend",
"//clang:tooling",
"//llvm:Support",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "driver_tests",
size = "small",
srcs = glob(
[
"Driver/*.cpp",
"Driver/*.h",
],
allow_empty = False,
exclude = [
"Driver/GCCVersionTest.cpp", # Includes private headers
],
),
deps = [
"//clang:basic",
"//clang:driver",
"//clang:frontend",
"//llvm:FrontendDebug",
"//llvm:MC",
"//llvm:Support",
"//llvm:TargetParser",
"//third-party/unittest:gmock",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "parse_tests",
size = "small",
srcs = glob(
["Parse/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:ast",
"//clang:basic",
"//clang:lex",
"//clang:parse",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "directory_watcher_tests",
size = "small",
srcs = glob(
["DirectoryWatcher/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:directory_watcher",
"//llvm:Support",
"//llvm:TestingSupport",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "index_tests",
size = "small",
srcs = glob(
["Index/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:ast",
"//clang:basic",
"//clang:frontend",
"//clang:index",
"//clang:lex",
"//clang:tooling",
"//llvm:Support",
"//third-party/unittest:gmock",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "install_api_tests",
size = "small",
srcs = glob(
["InstallAPI/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:install_api",
"//llvm:Support",
"//llvm:TestingSupport",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "interpreter_tests",
size = "small",
srcs = glob(
[
"Interpreter/*.cpp",
"Interpreter/*.h",
],
allow_empty = False,
),
args = [
# TODO: some tests fail with: "JIT session error: Symbols not found:
# [ _ZnwmPv26__clang_Interpreter_NewTag, __clang_Interpreter_SetValueWithAlloc ]
"--gtest_filter=-InterpreterTest.*",
],
deps = [
"//clang:ast",
"//clang:basic",
"//clang:codegen",
"//clang:frontend",
"//clang:interpreter",
"//clang:lex",
"//clang:parse",
"//clang:sema",
"//llvm:LineEditor",
"//llvm:MC",
"//llvm:OrcJIT",
"//llvm:OrcShared",
"//llvm:Support",
"//llvm:TargetParser",
"//llvm:TestingSupport",
"//llvm:ir_headers",
"//third-party/unittest:gmock",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "serialization_tests",
size = "small",
srcs = glob(
["Serialization/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:ast_matchers",
"//clang:basic",
"//clang:frontend",
"//clang:lex",
"//clang:parse",
"//clang:serialization",
"//clang:tooling",
"//llvm:Support",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)

cc_test(
name = "support_tests",
size = "small",
srcs = glob(
["Support/*.cpp"],
allow_empty = False,
),
deps = [
"//clang:frontend",
"//clang:lex",
"//llvm:Support",
"//third-party/unittest:gtest",
"//third-party/unittest:gtest_main",
],
)
Loading