Skip to content

Commit 848504d

Browse files
committed
only run the multi observer metrics test when built with abiv2
1 parent 37a57da commit 848504d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sdk/test/metrics/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ foreach(
3535
periodic_exporting_metric_reader_test
3636
instrument_metadata_validator_test
3737
metric_test_stress
38-
instrument_descriptor_test
39-
multi_observer_test)
38+
instrument_descriptor_test)
4039
add_executable(${testname} "${testname}.cc")
4140
target_link_libraries(
4241
${testname} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIB} ${CMAKE_THREAD_LIBS_INIT}
@@ -48,6 +47,18 @@ foreach(
4847
TEST_LIST ${testname})
4948
endforeach()
5049

50+
if(OPENTELEMETRY_ABI_VERSION_NO GREATER_EQUAL 2)
51+
add_executable(multi_observer_test multi_observer_test.cc)
52+
target_link_libraries(
53+
multi_observer_test ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIB}
54+
${CMAKE_THREAD_LIBS_INIT} metrics_common_test_utils opentelemetry_resources)
55+
target_compile_definitions(multi_observer_test PRIVATE UNIT_TESTING)
56+
gtest_add_tests(
57+
TARGET multi_observer_test
58+
TEST_PREFIX metrics.
59+
TEST_LIST multi_observer_test)
60+
endif()
61+
5162
if(WITH_BENCHMARK)
5263
add_executable(attributes_processor_benchmark
5364
attributes_processor_benchmark.cc)

0 commit comments

Comments
 (0)