| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- # Exceptions. See /LICENSE for license information.
- # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
- package(default_visibility = ["//visibility:public"])
- cc_library(
- name = "token_kind",
- srcs = ["token_kind.cpp"],
- hdrs = ["token_kind.h"],
- textual_hdrs = ["token_registry.def"],
- deps = [
- "//common:check",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "token_kind_test",
- size = "small",
- srcs = ["token_kind_test.cpp"],
- deps = [
- ":token_kind",
- "@com_google_googletest//:gtest_main",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "character_set",
- hdrs = ["character_set.h"],
- deps = ["@llvm-project//llvm:Support"],
- )
- cc_library(
- name = "test_helpers",
- testonly = 1,
- hdrs = ["test_helpers.h"],
- deps = [
- "//common:check",
- "//toolchain/diagnostics:diagnostic_emitter",
- "@com_google_googletest//:gtest",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "numeric_literal",
- srcs = ["numeric_literal.cpp"],
- hdrs = ["numeric_literal.h"],
- deps = [
- ":character_set",
- "//common:check",
- "//toolchain/diagnostics:diagnostic_emitter",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "numeric_literal_test",
- size = "small",
- srcs = ["numeric_literal_test.cpp"],
- deps = [
- ":numeric_literal",
- ":test_helpers",
- "//common:ostream",
- "//toolchain/diagnostics:diagnostic_emitter",
- "@com_google_googletest//:gtest_main",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_fuzz_test(
- name = "numeric_literal_fuzzer",
- size = "small",
- srcs = ["numeric_literal_fuzzer.cpp"],
- corpus = glob(["fuzzer_corpus/numeric_literal/*"]),
- deps = [
- ":numeric_literal",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/diagnostics:null_diagnostics",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "string_literal",
- srcs = ["string_literal.cpp"],
- hdrs = ["string_literal.h"],
- deps = [
- ":character_set",
- "//common:check",
- "//toolchain/diagnostics:diagnostic_emitter",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "string_literal_test",
- size = "small",
- srcs = ["string_literal_test.cpp"],
- deps = [
- ":string_literal",
- ":test_helpers",
- "//common:ostream",
- "//toolchain/diagnostics:diagnostic_emitter",
- "@com_google_googletest//:gtest_main",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_fuzz_test(
- name = "string_literal_fuzzer",
- size = "small",
- srcs = ["string_literal_fuzzer.cpp"],
- corpus = glob(["fuzzer_corpus/string_literal/*"]),
- deps = [
- ":string_literal",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/diagnostics:null_diagnostics",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "tokenized_buffer",
- srcs = ["tokenized_buffer.cpp"],
- hdrs = ["tokenized_buffer.h"],
- deps = [
- ":character_set",
- ":numeric_literal",
- ":string_literal",
- ":token_kind",
- "//common:check",
- "//common:ostream",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/source:source_buffer",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "tokenized_buffer_test_helpers",
- testonly = 1,
- hdrs = ["tokenized_buffer_test_helpers.h"],
- deps = [
- ":tokenized_buffer",
- "@com_google_googletest//:gtest",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "tokenized_buffer_test",
- size = "small",
- srcs = ["tokenized_buffer_test.cpp"],
- deps = [
- ":tokenized_buffer",
- ":tokenized_buffer_test_helpers",
- "//toolchain/common:yaml_test_helpers",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/diagnostics:mocks",
- "@com_google_googletest//:gtest_main",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_fuzz_test(
- name = "tokenized_buffer_fuzzer",
- size = "small",
- srcs = ["tokenized_buffer_fuzzer.cpp"],
- corpus = glob(["fuzzer_corpus/tokenized_buffer/*"]),
- deps = [
- ":tokenized_buffer",
- "//common:check",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/diagnostics:null_diagnostics",
- "@llvm-project//llvm:Support",
- ],
- )
|