BUILD 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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/file_test:file_test_base",
  56. "@abseil-cpp//absl/flags:flag",
  57. "@re2",
  58. ],
  59. )
  60. file_test(
  61. name = "file_test.notrace",
  62. size = "small",
  63. prebuilt_binary = ":file_test",
  64. shard_count = 20,
  65. tests = glob(["testdata/**/*.carbon"]),
  66. )
  67. file_test(
  68. name = "file_test.trace",
  69. size = "small",
  70. args = ["--trace"],
  71. prebuilt_binary = ":file_test",
  72. shard_count = 30,
  73. tests = glob(
  74. ["testdata/**/*.carbon"],
  75. exclude = [
  76. # `limits` tests check for various limit conditions (such as an
  77. # infinite loop). The tests collectively don't test tracing
  78. # because it creates substantial additional overhead.
  79. "testdata/limits/**",
  80. # `trace` tests do tracing by default.
  81. "testdata/trace/**",
  82. # Expensive tests to trace.
  83. "testdata/assoc_const/rewrite_large_type.carbon",
  84. "testdata/linked_list/typed_linked_list.carbon",
  85. ],
  86. ),
  87. )
  88. filegroup(
  89. name = "tree_sitter_testdata",
  90. srcs = glob(
  91. ["testdata/**/*.carbon"],
  92. exclude = [
  93. "testdata/**/fail_*",
  94. ],
  95. ),
  96. visibility = ["//utils/tree_sitter:__pkg__"],
  97. )