Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions exporters/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,16 @@ if(WITH_OTLP_FILE)
endif()

if(BUILD_TESTING)
add_executable(otlp_windows_max_macro_compile_test
test/otlp_windows_max_macro_compile_test.cc)
target_link_libraries(
otlp_windows_max_macro_compile_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_otlp_recordable)
gtest_add_tests(
TARGET otlp_windows_max_macro_compile_test
TEST_PREFIX exporter.otlp.
TEST_LIST otlp_windows_max_macro_compile_test)

add_executable(otlp_recordable_test test/otlp_recordable_test.cc)
target_link_libraries(
otlp_recordable_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
Expand Down
31 changes: 31 additions & 0 deletions exporters/otlp/test/otlp_windows_max_macro_compile_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <type_traits>

#define max(a, b) (((a) > (b)) ? (a) : (b))
#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h"
#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h"
#include "opentelemetry/exporters/otlp/otlp_recordable.h"
#undef max

#include <gtest/gtest.h>

OPENTELEMETRY_BEGIN_NAMESPACE
namespace exporter
{
namespace otlp
{

TEST(OtlpWindowsMaxMacroCompileTest, PublicHeadersCompile)
{
EXPECT_TRUE((std::is_class<OtlpFileExporterOptions>::value));
EXPECT_TRUE((std::is_class<OtlpGrpcExporterOptions>::value));
EXPECT_TRUE((std::is_class<OtlpHttpExporterOptions>::value));
EXPECT_TRUE((std::is_class<OtlpRecordable>::value));
}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
Loading