BUILD 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
  5. load("//bazel/cc_toolchains:defs.bzl", "cc_env")
  6. load("//testing/file_test:rules.bzl", "file_test")
  7. package(default_visibility = [
  8. "//bazel/check_deps:__pkg__",
  9. "//explorer:__subpackages__",
  10. "//installers:__subpackages__",
  11. ])
  12. filegroup(
  13. name = "standard_libraries",
  14. srcs = ["data/prelude.carbon"],
  15. )
  16. cc_library(
  17. name = "main",
  18. srcs = ["main.cpp"],
  19. hdrs = ["main.h"],
  20. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  21. # don't spend time linting it.
  22. tags = ["no-clang-tidy"],
  23. deps = [
  24. "//common:error",
  25. "//common:ostream",
  26. "//explorer/base:trace_stream",
  27. "//explorer/parse_and_execute",
  28. "@llvm-project//llvm:Support",
  29. ],
  30. )
  31. cc_binary(
  32. name = "explorer",
  33. srcs = ["main_bin.cpp"],
  34. env = cc_env(),
  35. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  36. # don't spend time linting it.
  37. tags = ["no-clang-tidy"],
  38. deps = [
  39. ":main",
  40. "//common:bazel_working_dir",
  41. "@llvm-project//llvm:Support",
  42. ],
  43. )
  44. cc_binary(
  45. name = "file_test",
  46. testonly = 1,
  47. srcs = ["file_test.cpp"],
  48. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  49. # don't spend time linting it.
  50. tags = ["no-clang-tidy"],
  51. deps = [
  52. ":main",
  53. "//common:check",
  54. "//common:raw_string_ostream",
  55. "//testing/base:file_helpers",
  56. "//testing/file_test:file_test_base",
  57. "//testing/file_test:manifest",
  58. "@abseil-cpp//absl/flags:flag",
  59. "@abseil-cpp//absl/strings",
  60. "@re2",
  61. ],
  62. )
  63. file_test(
  64. name = "file_test.notrace",
  65. size = "small",
  66. prebuilt_binary = ":file_test",
  67. shard_count = 20,
  68. tests = glob(["testdata/**/*.carbon"]),
  69. )
  70. file_test(
  71. name = "file_test.trace",
  72. size = "small",
  73. args = ["--trace"],
  74. prebuilt_binary = ":file_test",
  75. shard_count = 30,
  76. tests = glob(
  77. ["testdata/**/*.carbon"],
  78. exclude = [
  79. # `limits` tests check for various limit conditions (such as an
  80. # infinite loop). The tests collectively don't test tracing
  81. # because it creates substantial additional overhead.
  82. "testdata/limits/**",
  83. # `trace` tests do tracing by default.
  84. "testdata/trace/**",
  85. # Expensive tests to trace.
  86. "testdata/assoc_const/rewrite_large_type.carbon",
  87. "testdata/linked_list/typed_linked_list.carbon",
  88. ],
  89. ),
  90. )
  91. filegroup(
  92. name = "tree_sitter_testdata",
  93. srcs = glob(
  94. ["testdata/**/*.carbon"],
  95. exclude = [
  96. "testdata/**/fail_*",
  97. ],
  98. ),
  99. visibility = ["//utils/tree_sitter:__pkg__"],
  100. )