File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed 
include/opentelemetry/exporters/fluentd Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -133,16 +133,22 @@ if(OPENTELEMETRY_INSTALL)
133133endif ()
134134
135135if (BUILD_TESTING)
136-   include (GoogleTest)
136+   if (MAIN_PROJECT)
137+     find_package (GTest CONFIG REQUIRED)
138+   else ()
139+     if  (NOT  DEFINED  GTEST_BOTH_LIBRARIES)
140+       message (STATUS_FATAL, "Test is not enable." )
141+     endif ()
142+   endif ()
143+   # include(GoogleTest) 
137144  # build trace exporter tests 
138145  add_executable (
139146    fluentd_recordable_trace_test test /trace/fluentd_recordable_test.cc
140147                                  test /trace/fluentd_baseline_test.cc)
141148
142149  target_link_libraries (
143150    fluentd_recordable_trace_test
144-     gtest
145-     gtest_main
151+     ${GTEST_BOTH_LIBRARIES} 
146152    ${CMAKE_THREAD_LIBS_INIT} 
147153    opentelemetry_common
148154    opentelemetry_trace
@@ -164,8 +170,7 @@ if(BUILD_TESTING)
164170
165171  target_link_libraries (
166172    fluentd_recordable_logs_test
167-     gtest
168-     gtest_main
173+     ${GTEST_BOTH_LIBRARIES} 
169174    ${CMAKE_THREAD_LIBS_INIT} 
170175    opentelemetry_common
171176    opentelemetry_logs
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ class FluentdExporter final : public logs_sdk::LogRecordExporter {
5050  Export (const  nostd::span<std::unique_ptr<logs_sdk::Recordable>>
5151             &logs) noexcept  override ;
5252
53+   bool  ForceFlush (
54+       std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept  override 
55+   {
56+         return  true ;
57+   }
58+ 
5359  /* *
5460   * Shut down the exporter. 
5561   * @param timeout an optional timeout, default to max. 
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ class FluentdExporter final : public trace_sdk::SpanExporter {
5555  Export (const  nostd::span<std::unique_ptr<trace_sdk::Recordable>>
5656             &spans) noexcept  override ;
5757
58+   bool  ForceFlush (
59+       std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept  override 
60+   {
61+         return  true ;
62+   }
63+ 
5864  /* *
5965   * Shut down the exporter. 
6066   * @param timeout an optional timeout, default to max. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments