1# Copyright 2019 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("//fcp:config.bzl", "FCP_COPTS") 16load("//fcp/tracing:build_defs.bzl", "tracing_schema_cc_library") 17 18package( 19 default_visibility = ["//fcp:internal"], 20 licenses = ["notice"], # Apache 2.0 21) 22 23tracing_schema_cc_library( 24 name = "tracing_schema", 25 srcs = ["tracing_schema.fbs"], 26) 27 28cc_test( 29 name = "tracing_test", 30 srcs = [ 31 "tracing_test.cc", 32 ], 33 copts = FCP_COPTS, 34 deps = [ 35 ":tracing_schema", 36 "//fcp/tracing:test_tracing_recorder", 37 "@com_google_googletest//:gtest_main", 38 "@flatbuffers", 39 ], 40) 41 42cc_test( 43 name = "text_tracing_test", 44 srcs = ["text_tracing_test.cc"], 45 copts = FCP_COPTS, 46 data = glob([ 47 "testdata/*.baseline", 48 ]), 49 deps = [ 50 ":tracing_schema", 51 "//fcp/base", 52 "//fcp/testing", 53 "//fcp/tracing", 54 "@com_google_absl//absl/strings", 55 "@com_google_googletest//:gtest_main", 56 "@com_googlesource_code_re2//:re2", 57 ], 58) 59 60cc_test( 61 name = "tracing_context_utils_test", 62 srcs = ["tracing_context_utils_test.cc"], 63 copts = FCP_COPTS, 64 deps = [ 65 ":test_api_message_cc_proto", 66 "//fcp/tracing:tracing_context_utils", 67 "@com_google_googletest//:gtest_main", 68 ], 69) 70 71cc_test( 72 name = "thread_local_tracing_recorder_test", 73 srcs = ["thread_local_tracing_recorder_test.cc"], 74 copts = FCP_COPTS, 75 data = glob([ 76 "testdata/*.baseline", 77 ]), 78 deps = [ 79 ":tracing_schema", 80 "//fcp/base", 81 "//fcp/base:scheduler", 82 "//fcp/testing", 83 "//fcp/tracing", 84 "@com_google_absl//absl/strings", 85 "@com_google_absl//absl/time", 86 "@com_google_googletest//:gtest_main", 87 "@com_googlesource_code_re2//:re2", 88 ], 89) 90 91proto_library( 92 name = "test_api_message_proto", 93 srcs = ["test_api_message.proto"], 94) 95 96cc_proto_library( 97 name = "test_api_message_cc_proto", 98 deps = [":test_api_message_proto"], 99) 100