Skip to content

Commit 8469b16

Browse files
committed
merged from upstream
2 parents d103cdc + d15da3b commit 8469b16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+554
-272
lines changed

.github/workflows/iwyu.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,16 @@ jobs:
6262

6363
- name: count warnings
6464
run: |
65+
set +e
6566
cd build
66-
COUNT=`grep -c "Warning:" iwyu.log`
67-
echo "include-what-you-use reported ${COUNT} warning(s)"
68-
67+
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
68+
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
69+
# Acceptable limit, to decrease over time down to 0
70+
readonly WARNING_LIMIT=10
71+
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
72+
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
73+
exit 1
74+
# WARN in annotations if WARNING_COUNT > 0
75+
elif [ $WARNING_COUNT -gt 0 ] ; then
76+
echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s)"
77+
fi

.iwyu.imp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
[
77
# Work around for C++ STL
88
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
9+
{ "include": ["<bits/std_abs.h>", "private", "<cstdlib>", "public"] },
10+
{ "include": ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },
11+
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
12+
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },
913

1014
# Local opentelemetry-cpp style
1115

@@ -14,6 +18,7 @@
1418
{ "include": ["<gtest/gtest-test-part.h>", "private", "<gtest/gtest.h>", "public"] },
1519
{ "include": ["<gtest/gtest-param-test.h>", "private", "<gtest/gtest.h>", "public"] },
1620
{ "include": ["<gtest/gtest_pred_impl.h>", "private", "<gtest/gtest.h>", "public"] },
21+
{ "include": ["<gtest/gtest-typed-test.h>", "private", "<gtest/gtest.h>", "public"] },
1722

1823
# We prefer to include <gmock/gmock.h> for simplicity
1924
{ "include": ["<gmock/gmock-function-mocker.h>", "private", "<gmock/gmock.h>", "public"] },

api/include/opentelemetry/nostd/variant.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ OPENTELEMETRY_END_NAMESPACE
5454
# ifdef HAVE_ABSEIL
5555
# include "absl/types/variant.h"
5656
# else
57+
# include "opentelemetry/nostd/internal/absl/base/options.h"
58+
59+
namespace absl
60+
{
61+
namespace OTABSL_OPTION_NAMESPACE_NAME
62+
{
63+
template <class T>
64+
struct variant_size;
65+
template <typename... Ts>
66+
class variant;
67+
} // namespace OTABSL_OPTION_NAMESPACE_NAME
68+
} // namespace absl
69+
5770
# include "opentelemetry/nostd/internal/absl/types/variant.h"
5871
# endif
5972

api/test/trace/propagation/detail/string_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include <gtest/gtest.h>
5-
#include <opentelemetry/trace/propagation/b3_propagator.h>
6-
#include <string>
5+
#include <stddef.h>
6+
#include <ostream>
7+
#include <vector>
78

89
#include "opentelemetry/nostd/string_view.h"
10+
#include "opentelemetry/trace/propagation/detail/string.h"
911

1012
using namespace opentelemetry;
1113

exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_data.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include <stddef.h>
67
#include <map>
78
#include <memory>
89
#include <string>
@@ -11,15 +12,10 @@
1112
#include "opentelemetry/version.h"
1213
#include "opentelemetry/exporters/memory/in_memory_data.h"
1314
#include "opentelemetry/sdk/metrics/data/metric_data.h"
15+
#include "opentelemetry/sdk/metrics/export/metric_producer.h"
16+
#include "opentelemetry/version.h"
1417

1518
OPENTELEMETRY_BEGIN_NAMESPACE
16-
namespace sdk
17-
{
18-
namespace metrics
19-
{
20-
struct ResourceMetrics;
21-
}
22-
} // namespace sdk
2319
namespace exporter
2420
{
2521
namespace memory

exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,16 @@
66
#include <memory>
77

88
#include "opentelemetry/version.h"
9+
#include "opentelemetry/exporters/memory/in_memory_metric_data.h"
10+
#include "opentelemetry/sdk/metrics/instruments.h"
11+
#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
912
#include "opentelemetry/sdk/metrics/instruments.h"
1013

1114
OPENTELEMETRY_BEGIN_NAMESPACE
12-
namespace sdk
13-
{
14-
namespace metrics
15-
{
16-
class PushMetricExporter;
17-
} // namespace metrics
18-
} // namespace sdk
1915
namespace exporter
2016
{
2117
namespace memory
2218
{
23-
class InMemoryMetricData;
2419

2520
/// A factory for InMemoryMetricExporter
2621
class OPENTELEMETRY_EXPORT InMemoryMetricExporterFactory

exporters/memory/src/in_memory_metric_data.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#include <stddef.h>
5+
#include <map>
6+
#include <memory>
7+
#include <string>
8+
#include <tuple>
9+
#include <utility>
10+
#include <vector>
11+
12+
#include "opentelemetry/exporters/memory/in_memory_data.h"
413
#include "opentelemetry/exporters/memory/in_memory_metric_data.h"
14+
#include "opentelemetry/nostd/variant.h"
515
#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
16+
#include "opentelemetry/sdk/metrics/data/metric_data.h"
617
#include "opentelemetry/sdk/metrics/export/metric_producer.h"
18+
#include "opentelemetry/sdk/metrics/instruments.h"
19+
#include "opentelemetry/version.h"
720

821
OPENTELEMETRY_BEGIN_NAMESPACE
922
namespace exporter

exporters/memory/src/in_memory_metric_exporter_factory.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
#include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h"
4+
#include <atomic>
5+
#include <chrono>
6+
#include <memory>
7+
58
#include "opentelemetry/exporters/memory/in_memory_metric_data.h"
9+
#include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h"
10+
#include "opentelemetry/sdk/common/exporter_utils.h"
611
#include "opentelemetry/sdk/common/global_log_handler.h"
712
#include "opentelemetry/sdk/metrics/export/metric_producer.h"
13+
#include "opentelemetry/sdk/metrics/instruments.h"
814
#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
15+
#include "opentelemetry/version.h"
916

1017
OPENTELEMETRY_BEGIN_NAMESPACE
1118
namespace exporter

exporters/memory/test/in_memory_metric_data_test.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#include <gtest/gtest.h>
5+
#include <algorithm>
6+
#include <map>
7+
#include <memory>
8+
#include <string>
9+
#include <utility>
10+
#include <vector>
11+
412
#include "opentelemetry/exporters/memory/in_memory_metric_data.h"
13+
#include "opentelemetry/nostd/variant.h"
514
#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
15+
#include "opentelemetry/sdk/metrics/data/metric_data.h"
16+
#include "opentelemetry/sdk/metrics/data/point_data.h"
617
#include "opentelemetry/sdk/metrics/export/metric_producer.h"
18+
#include "opentelemetry/sdk/metrics/instruments.h"
719
#include "opentelemetry/sdk/resource/resource.h"
820

9-
#include <gtest/gtest.h>
10-
11-
#include <vector>
12-
1321
using opentelemetry::exporter::memory::CircularBufferInMemoryMetricData;
1422
using opentelemetry::exporter::memory::SimpleAggregateInMemoryMetricData;
1523
using opentelemetry::sdk::metrics::MetricData;

exporters/memory/test/in_memory_metric_exporter_test.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#include <gtest/gtest.h>
5+
#include <memory>
6+
#include <vector>
7+
48
#include "opentelemetry/exporters/memory/in_memory_metric_data.h"
59
#include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h"
10+
#include "opentelemetry/sdk/common/exporter_utils.h"
611
#include "opentelemetry/sdk/metrics/export/metric_producer.h"
712
#include "opentelemetry/sdk/metrics/instruments.h"
813
#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
914
#include "opentelemetry/sdk/resource/resource.h"
1015

11-
#include <gtest/gtest.h>
12-
1316
using opentelemetry::exporter::memory::CircularBufferInMemoryMetricData;
1417
using opentelemetry::exporter::memory::InMemoryMetricExporterFactory;
1518
using opentelemetry::sdk::common::ExportResult;

0 commit comments

Comments
 (0)