|
| 1 | +# OpenCensus C++ internal libraries. |
| 2 | +# |
| 3 | +# Copyright 2017, OpenCensus Authors |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +licenses(["notice"]) # Apache 2.0 |
| 18 | + |
| 19 | +package(default_visibility = ["//opencensus:__subpackages__"]) |
| 20 | + |
| 21 | +cc_library( |
| 22 | + name = "random_lib", |
| 23 | + srcs = ["random.cc"], |
| 24 | + hdrs = ["random.h"], |
| 25 | + deps = [ |
| 26 | + "@com_google_absl//absl/synchronization", |
| 27 | + "@com_google_absl//absl/time", |
| 28 | + ], |
| 29 | +) |
| 30 | + |
| 31 | +cc_library( |
| 32 | + name = "stats_object", |
| 33 | + hdrs = ["stats_object.h"], |
| 34 | + deps = [ |
| 35 | + "@com_google_absl//absl/base:core_headers", |
| 36 | + "@com_google_absl//absl/memory", |
| 37 | + "@com_google_absl//absl/strings", |
| 38 | + "@com_google_absl//absl/time", |
| 39 | + "@com_google_absl//absl/types:span", |
| 40 | + ], |
| 41 | +) |
| 42 | + |
| 43 | +cc_library( |
| 44 | + name = "string_vector_hash", |
| 45 | + hdrs = ["string_vector_hash.h"], |
| 46 | +) |
| 47 | + |
| 48 | +# Tests |
| 49 | +# ========================================================================= # |
| 50 | + |
| 51 | +cc_test( |
| 52 | + name = "random_test", |
| 53 | + srcs = ["random_test.cc"], |
| 54 | + deps = [ |
| 55 | + ":random_lib", |
| 56 | + "@com_google_googletest//:gtest_main", |
| 57 | + ], |
| 58 | +) |
| 59 | + |
| 60 | +cc_binary( |
| 61 | + name = "random_benchmark", |
| 62 | + testonly = 1, |
| 63 | + srcs = ["random_benchmark.cc"], |
| 64 | + linkopts = ["-pthread"], # Required for absl/synchronization bits. |
| 65 | + linkstatic = 1, |
| 66 | + deps = [ |
| 67 | + ":random_lib", |
| 68 | + "@com_google_benchmark//:benchmark", |
| 69 | + ], |
| 70 | +) |
| 71 | + |
| 72 | +cc_test( |
| 73 | + name = "stats_object_test", |
| 74 | + srcs = ["stats_object_test.cc"], |
| 75 | + deps = [ |
| 76 | + ":stats_object", |
| 77 | + "@com_google_absl//absl/strings", |
| 78 | + "@com_google_absl//absl/types:span", |
| 79 | + "@com_google_googletest//:gtest_main", |
| 80 | + ], |
| 81 | +) |
0 commit comments