Skip to content

Commit

Permalink
Merge branch 'main' into metrics-sdk-views-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Dec 16, 2021
2 parents 447cece + b021bd6 commit c28426b
Show file tree
Hide file tree
Showing 33 changed files with 436 additions and 28 deletions.
1 change: 1 addition & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ cc_library(
name = "api",
hdrs = glob(["include/**/*.h"]),
strip_include_prefix = "include",
tags = ["api"],
)
17 changes: 15 additions & 2 deletions api/include/opentelemetry/nostd/absl/meta/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,21 @@ using common_type_t = typename std::common_type<T...>::type;
template <typename T>
using underlying_type_t = typename std::underlying_type<T>::type;

template <typename T>
using result_of_t = typename std::result_of<T>::type;
namespace type_traits_internal {

#if __cplusplus >= 201703L
// std::result_of is deprecated (C++17) or removed (C++20)
template<typename> struct result_of;
template<typename F, typename... Args>
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
#else
template<typename F> using result_of = std::result_of<F>;
#endif

} // namespace type_traits_internal

template<typename F>
using result_of_t = typename type_traits_internal::result_of<F>::type;

namespace type_traits_internal {
// In MSVC we can't probe std::hash or stdext::hash because it triggers a
Expand Down
15 changes: 15 additions & 0 deletions api/test/_metrics/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ cc_test(
srcs = [
"meter_provider_test.cc",
],
tags = [
"api",
"metrics",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -16,6 +21,11 @@ cc_test(
srcs = [
"noop_metrics_test.cc",
],
tags = [
"api",
"metrics",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -28,6 +38,11 @@ cc_test(
"noop_instrument_test.cc",
],
linkstatic = 1,
tags = [
"api",
"metrics",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
8 changes: 8 additions & 0 deletions api/test/baggage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cc_test(
srcs = [
"baggage_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -14,5 +18,9 @@ cc_test(
otel_cc_benchmark(
name = "baggage_benchmark",
srcs = ["baggage_benchmark.cc"],
tags = [
"api",
"test",
],
deps = ["//api"],
)
4 changes: 4 additions & 0 deletions api/test/baggage/propagation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cc_test(
srcs = [
"baggage_propagator_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
12 changes: 12 additions & 0 deletions api/test/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark")
otel_cc_benchmark(
name = "spinlock_benchmark",
srcs = ["spinlock_benchmark.cc"],
tags = [
"api",
"test",
],
deps = ["//api"],
)

Expand All @@ -11,6 +15,10 @@ cc_test(
srcs = [
"kv_properties_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -22,6 +30,10 @@ cc_test(
srcs = [
"string_util_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
8 changes: 8 additions & 0 deletions api/test/context/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cc_test(
srcs = [
"context_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -16,6 +20,10 @@ cc_test(
srcs = [
"runtime_context_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
4 changes: 4 additions & 0 deletions api/test/context/propagation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cc_test(
srcs = [
"composite_propagator_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
4 changes: 4 additions & 0 deletions api/test/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ cc_test(
srcs = [
"timestamp_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
10 changes: 10 additions & 0 deletions api/test/logs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ cc_test(
srcs = [
"provider_test.cc",
],
tags = [
"api",
"logs",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -16,6 +21,11 @@ cc_test(
srcs = [
"logger_test.cc",
],
tags = [
"api",
"logs",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
28 changes: 28 additions & 0 deletions api/test/nostd/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ cc_test(
srcs = [
"function_ref_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -14,6 +18,10 @@ cc_test(
srcs = [
"string_view_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -25,6 +33,10 @@ cc_test(
srcs = [
"variant_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -36,6 +48,10 @@ cc_test(
srcs = [
"unique_ptr_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -47,6 +63,10 @@ cc_test(
srcs = [
"utility_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -58,6 +78,10 @@ cc_test(
srcs = [
"span_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand All @@ -69,6 +93,10 @@ cc_test(
srcs = [
"shared_ptr_test.cc",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
4 changes: 4 additions & 0 deletions api/test/plugin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ cc_test(
linkopts = [
"-ldl",
],
tags = [
"api",
"test",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
Expand Down
Loading

0 comments on commit c28426b

Please sign in to comment.