CMakeLists.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright The OpenTelemetry Authors
  2. # SPDX-License-Identifier: Apache-2.0
  3. add_library(metrics_common_test_utils common.cc)
  4. target_link_libraries(metrics_common_test_utils opentelemetry_metrics)
  5. foreach(
  6. testname
  7. meter_config_test
  8. meter_provider_set_test
  9. meter_provider_sdk_test
  10. meter_test
  11. view_registry_test
  12. aggregation_test
  13. sum_aggregation_test
  14. histogram_aggregation_test
  15. attributes_processor_test
  16. attributes_hashmap_test
  17. base2_exponential_histogram_indexer_test
  18. circular_buffer_counter_test
  19. cardinality_limit_test
  20. histogram_test
  21. sync_metric_storage_counter_test
  22. sync_metric_storage_gauge_test
  23. sync_metric_storage_histogram_test
  24. sync_metric_storage_up_down_counter_test
  25. async_metric_storage_test
  26. multi_metric_storage_test
  27. observer_result_test
  28. sync_instruments_test
  29. async_instruments_test
  30. metric_collector_test
  31. metric_reader_test
  32. observable_registry_test
  33. periodic_exporting_metric_reader_test
  34. instrument_metadata_validator_test
  35. metric_test_stress
  36. instrument_descriptor_test)
  37. add_executable(${testname} "${testname}.cc")
  38. target_link_libraries(
  39. ${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
  40. metrics_common_test_utils opentelemetry_resources)
  41. target_compile_definitions(${testname} PRIVATE UNIT_TESTING)
  42. gtest_add_tests(
  43. TARGET ${testname}
  44. TEST_PREFIX metrics.
  45. TEST_LIST ${testname})
  46. endforeach()
  47. if(WITH_BENCHMARK)
  48. add_executable(attributes_processor_benchmark
  49. attributes_processor_benchmark.cc)
  50. target_link_libraries(attributes_processor_benchmark benchmark::benchmark
  51. ${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)
  52. add_executable(attributes_hashmap_benchmark attributes_hashmap_benchmark.cc)
  53. target_link_libraries(attributes_hashmap_benchmark benchmark::benchmark
  54. ${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)
  55. add_executable(base2_exponential_histogram_indexer_benchmark
  56. base2_exponential_histogram_indexer_benchmark.cc)
  57. target_link_libraries(
  58. base2_exponential_histogram_indexer_benchmark benchmark::benchmark
  59. opentelemetry_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)
  60. add_executable(histogram_aggregation_benchmark
  61. histogram_aggregation_benchmark.cc)
  62. target_link_libraries(
  63. histogram_aggregation_benchmark benchmark::benchmark
  64. ${CMAKE_THREAD_LIBS_INIT} metrics_common_test_utils opentelemetry_common
  65. opentelemetry_resources)
  66. add_executable(measurements_benchmark measurements_benchmark.cc)
  67. target_link_libraries(
  68. measurements_benchmark benchmark::benchmark opentelemetry_metrics
  69. opentelemetry_resources ${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)
  70. add_executable(sum_aggregation_benchmark sum_aggregation_benchmark.cc)
  71. target_link_libraries(
  72. sum_aggregation_benchmark benchmark::benchmark ${CMAKE_THREAD_LIBS_INIT}
  73. metrics_common_test_utils opentelemetry_common opentelemetry_resources)
  74. endif()
  75. add_subdirectory(exemplar)