From c104f96ca5052f1f4736206795382098c4484d50 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Tue, 12 Mar 2019 21:12:58 +0100 Subject: [PATCH 01/11] add benchmark to fetchcontent --- cmake/OpenCensusDeps.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/OpenCensusDeps.cmake b/cmake/OpenCensusDeps.cmake index 0cac7250..3f799949 100644 --- a/cmake/OpenCensusDeps.cmake +++ b/cmake/OpenCensusDeps.cmake @@ -29,6 +29,11 @@ fetchcontent_declare(prometheus https://github.com/jupp0r/prometheus-cpp GIT_TAG master) +fetchcontent_declare(benchmark + GIT_REPOSITORY + https://github.com/google/benchmark + GIT_TAG + master) fetchcontent_getproperties(googletest) if(BUILD_TESTING) @@ -72,3 +77,10 @@ if(NOT prometheus_POPULATED) add_subdirectory(${prometheus_SOURCE_DIR} ${prometheus_BINARY_DIR} EXCLUDE_FROM_ALL) endif() + +fetchcontent_getproperties(benchmark) +if(NOT benchmark_POPULATED) + set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE) + fetchcontent_populate(benchmark) + add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR} EXCLUDE_FROM_ALL) +endif() From 46fc1ae9d1f05c93f424769076d889323a62efb8 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Tue, 12 Mar 2019 21:13:15 +0100 Subject: [PATCH 02/11] add benchmark helper function and first benchmark --- cmake/OpenCensusHelpers.cmake | 13 ++++ opencensus/common/internal/CMakeLists.txt | 82 +++++++++++------------ 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake index d511ac09..57a82c78 100644 --- a/cmake/OpenCensusHelpers.cmake +++ b/cmake/OpenCensusHelpers.cmake @@ -38,6 +38,19 @@ function(opencensus_test NAME SRC) endif() endfunction() +# Helper function like bazel's cc_test. Usage: +# +# opencensus_benchmark(trace_some_test internal/some_test.cc dep1 dep2...) +function(opencensus_benchmark NAME SRC) + #if(BUILD_TESTING) + set(_NAME "opencensus_${NAME}") + add_executable(${_NAME} ${SRC}) + prepend_opencensus(DEPS "${ARGN}") + target_link_libraries(${_NAME} "${DEPS}" benchmark) + #add_test(NAME ${_NAME} COMMAND ${_NAME}) + #endif() +endfunction() + # Helper function like bazel's cc_library. Libraries are namespaced as # opencensus_* and public libraries are also aliased as opencensus-cpp::*. function(opencensus_lib NAME) diff --git a/opencensus/common/internal/CMakeLists.txt b/opencensus/common/internal/CMakeLists.txt index b6ee2671..e215bd41 100644 --- a/opencensus/common/internal/CMakeLists.txt +++ b/opencensus/common/internal/CMakeLists.txt @@ -1,41 +1,41 @@ -# Copyright 2018, OpenCensus Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -opencensus_lib(common_hash_mix) - -opencensus_lib(common_random - SRCS - random.cc - DEPS - absl::base - absl::synchronization - absl::time) - -opencensus_lib(common_stats_object DEPS absl::time) - -# Define NOMINMAX to fix build errors when compiling with MSVC. -target_compile_definitions(opencensus_common_stats_object INTERFACE - $<$:NOMINMAX>) - -opencensus_lib(common_string_vector_hash) - -opencensus_test(common_random_test random_test.cc common_random) - -opencensus_test(common_stats_object_test - stats_object_test.cc - common_stats_object - absl::strings - absl::span) - -# TODO: random_benchmark +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +opencensus_lib(common_hash_mix) + +opencensus_lib(common_random + SRCS + random.cc + DEPS + absl::base + absl::synchronization + absl::time) + +opencensus_lib(common_stats_object DEPS absl::time) + +# Define NOMINMAX to fix build errors when compiling with MSVC. +target_compile_definitions(opencensus_common_stats_object INTERFACE + $<$:NOMINMAX>) + +opencensus_lib(common_string_vector_hash) + +opencensus_test(common_random_test random_test.cc common_random) + +opencensus_benchmark(common_random_benchmark random_benchmark.cc common_random) + +opencensus_test(common_stats_object_test + stats_object_test.cc + common_stats_object + absl::strings + absl::span) From f1d601718f983094b09d223f877fd9065bbdc9b7 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Wed, 13 Mar 2019 19:19:24 +0100 Subject: [PATCH 03/11] added benchmarks --- opencensus/context/CMakeLists.txt | 2 +- opencensus/stats/CMakeLists.txt | 2 +- opencensus/tags/CMakeLists.txt | 2 +- opencensus/trace/CMakeLists.txt | 14 +++++++++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/opencensus/context/CMakeLists.txt b/opencensus/context/CMakeLists.txt index 589a7209..166e9b1f 100644 --- a/opencensus/context/CMakeLists.txt +++ b/opencensus/context/CMakeLists.txt @@ -31,4 +31,4 @@ opencensus_test(context_context_test opencensus_test(context_with_context_test internal/with_context_test.cc context) -# TODO: context_benchmark +opencensus_benchmark(context_context_benchmark internal/context_benchmark.cc context) diff --git a/opencensus/stats/CMakeLists.txt b/opencensus/stats/CMakeLists.txt index 6194fedf..1c760646 100644 --- a/opencensus/stats/CMakeLists.txt +++ b/opencensus/stats/CMakeLists.txt @@ -116,4 +116,4 @@ opencensus_test(stats_view_data_impl_test stats_core absl::time) -# TODO: benchmarks +opencensus_benchmark(stats_stats_manager_benchmark internal/stats_manager_benchmark.cc stats_core stats_recording absl::memory absl::strings absl::time) diff --git a/opencensus/tags/CMakeLists.txt b/opencensus/tags/CMakeLists.txt index 26581460..8cdc4a8f 100644 --- a/opencensus/tags/CMakeLists.txt +++ b/opencensus/tags/CMakeLists.txt @@ -57,4 +57,4 @@ opencensus_test(tags_with_tag_map_test tags_with_tag_map context) -# TODO: benchmarks +opencensus_benchmark(tags_tag_map_benchmark internal/tag_map_benchmark.cc tags absl::strings) diff --git a/opencensus/trace/CMakeLists.txt b/opencensus/trace/CMakeLists.txt index a0f77232..1fc65450 100644 --- a/opencensus/trace/CMakeLists.txt +++ b/opencensus/trace/CMakeLists.txt @@ -190,4 +190,16 @@ opencensus_test(trace_with_span_test trace_with_span context) -# TODO: benchmarks +opencensus_benchmark(trace_attribute_value_ref_benchmark internal/attribute_value_ref_benchmark.cc trace) + +opencensus_benchmark(trace_cloud_trace_context_benchmark internal/cloud_trace_context_benchmark.cc trace_cloud_trace_context) + +opencensus_benchmark(trace_grpc_trace_bin_benchmark internal/grpc_trace_bin_benchmark.cc trace_grpc_trace_bin) + +opencensus_benchmark(trace_span_benchmark internal/span_benchmark.cc trace_span_context trace) + +opencensus_benchmark(trace_span_id_benchmark internal/span_id_benchmark.cc trace_span_context) + +opencensus_benchmark(trace_context_benchmark internal/trace_context_benchmark.cc trace_trace_context) + +opencensus_benchmark(trace_with_span_benchmark internal/with_span_benchmark.cc trace trace_with_span) From 1b2552a50000df6dba93a29dda052157847ee6a2 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Wed, 13 Mar 2019 19:26:35 +0100 Subject: [PATCH 04/11] add running benchmarks to appveyor --- .appveyor.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 4e2c99ee..6bd8256d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -31,6 +31,11 @@ test_script: & $_.FullName $cmdArgList } + Get-ChildItem -Recurse -Path $env:APPVEYOR_BUILD_FOLDER -Filter "*_benchmark.exe" | ForEach-Object { + Write-Output $_.FullName + + & $_.FullName + } on_finish: - ps: | From 1b2f3617acd449b2467633f33c085eb4ccfce3b1 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Thu, 14 Mar 2019 06:49:04 +0100 Subject: [PATCH 05/11] fix line endings common_internal_cmakelists.txt --- opencensus/common/internal/CMakeLists.txt | 82 +++++++++++------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/opencensus/common/internal/CMakeLists.txt b/opencensus/common/internal/CMakeLists.txt index e215bd41..c18859dd 100644 --- a/opencensus/common/internal/CMakeLists.txt +++ b/opencensus/common/internal/CMakeLists.txt @@ -1,41 +1,41 @@ -# Copyright 2018, OpenCensus Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -opencensus_lib(common_hash_mix) - -opencensus_lib(common_random - SRCS - random.cc - DEPS - absl::base - absl::synchronization - absl::time) - -opencensus_lib(common_stats_object DEPS absl::time) - -# Define NOMINMAX to fix build errors when compiling with MSVC. -target_compile_definitions(opencensus_common_stats_object INTERFACE - $<$:NOMINMAX>) - -opencensus_lib(common_string_vector_hash) - -opencensus_test(common_random_test random_test.cc common_random) - -opencensus_benchmark(common_random_benchmark random_benchmark.cc common_random) - -opencensus_test(common_stats_object_test - stats_object_test.cc - common_stats_object - absl::strings - absl::span) +# Copyright 2018, OpenCensus Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +opencensus_lib(common_hash_mix) + +opencensus_lib(common_random + SRCS + random.cc + DEPS + absl::base + absl::synchronization + absl::time) + +opencensus_lib(common_stats_object DEPS absl::time) + +# Define NOMINMAX to fix build errors when compiling with MSVC. +target_compile_definitions(opencensus_common_stats_object INTERFACE + $<$:NOMINMAX>) + +opencensus_lib(common_string_vector_hash) + +opencensus_test(common_random_test random_test.cc common_random) + +opencensus_benchmark(common_random_benchmark random_benchmark.cc common_random) + +opencensus_test(common_stats_object_test + stats_object_test.cc + common_stats_object + absl::strings + absl::span) From a8863efc0110bd08f6293206d976eafe116a10bc Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Tue, 2 Apr 2019 17:22:09 +0200 Subject: [PATCH 06/11] formatting --- .appveyor.yml | 2 +- cmake/OpenCensusDeps.cmake | 15 +++++++++------ cmake/OpenCensusHelpers.cmake | 13 ++++++------- opencensus/context/CMakeLists.txt | 3 ++- opencensus/stats/CMakeLists.txt | 8 +++++++- opencensus/tags/CMakeLists.txt | 5 ++++- opencensus/trace/CMakeLists.txt | 26 +++++++++++++++++++------- 7 files changed, 48 insertions(+), 24 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6bd8256d..f2b321c9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,7 +33,7 @@ test_script: } Get-ChildItem -Recurse -Path $env:APPVEYOR_BUILD_FOLDER -Filter "*_benchmark.exe" | ForEach-Object { Write-Output $_.FullName - + & $_.FullName } diff --git a/cmake/OpenCensusDeps.cmake b/cmake/OpenCensusDeps.cmake index 3f799949..1801ad9c 100644 --- a/cmake/OpenCensusDeps.cmake +++ b/cmake/OpenCensusDeps.cmake @@ -30,10 +30,10 @@ fetchcontent_declare(prometheus GIT_TAG master) fetchcontent_declare(benchmark - GIT_REPOSITORY - https://github.com/google/benchmark - GIT_TAG - master) + GIT_REPOSITORY + https://github.com/google/benchmark + GIT_TAG + master) fetchcontent_getproperties(googletest) if(BUILD_TESTING) @@ -80,7 +80,10 @@ endif() fetchcontent_getproperties(benchmark) if(NOT benchmark_POPULATED) - set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE) + set(BENCHMARK_ENABLE_GTEST_TESTS OFF + CACHE BOOL "Enable building the unit tests which depend on gtest" + FORCE) fetchcontent_populate(benchmark) - add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR} EXCLUDE_FROM_ALL) + add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR} + EXCLUDE_FROM_ALL) endif() diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake index 57a82c78..5a3b0f5d 100644 --- a/cmake/OpenCensusHelpers.cmake +++ b/cmake/OpenCensusHelpers.cmake @@ -42,13 +42,12 @@ endfunction() # # opencensus_benchmark(trace_some_test internal/some_test.cc dep1 dep2...) function(opencensus_benchmark NAME SRC) - #if(BUILD_TESTING) - set(_NAME "opencensus_${NAME}") - add_executable(${_NAME} ${SRC}) - prepend_opencensus(DEPS "${ARGN}") - target_link_libraries(${_NAME} "${DEPS}" benchmark) - #add_test(NAME ${_NAME} COMMAND ${_NAME}) - #endif() + # if(BUILD_TESTING) + set(_NAME "opencensus_${NAME}") + add_executable(${_NAME} ${SRC}) + prepend_opencensus(DEPS "${ARGN}") + target_link_libraries(${_NAME} "${DEPS}" benchmark) + # add_test(NAME ${_NAME} COMMAND ${_NAME}) endif() endfunction() # Helper function like bazel's cc_library. Libraries are namespaced as diff --git a/opencensus/context/CMakeLists.txt b/opencensus/context/CMakeLists.txt index 166e9b1f..525885b9 100644 --- a/opencensus/context/CMakeLists.txt +++ b/opencensus/context/CMakeLists.txt @@ -31,4 +31,5 @@ opencensus_test(context_context_test opencensus_test(context_with_context_test internal/with_context_test.cc context) -opencensus_benchmark(context_context_benchmark internal/context_benchmark.cc context) +opencensus_benchmark(context_context_benchmark internal/context_benchmark.cc + context) diff --git a/opencensus/stats/CMakeLists.txt b/opencensus/stats/CMakeLists.txt index 1c760646..bcb5870b 100644 --- a/opencensus/stats/CMakeLists.txt +++ b/opencensus/stats/CMakeLists.txt @@ -116,4 +116,10 @@ opencensus_test(stats_view_data_impl_test stats_core absl::time) -opencensus_benchmark(stats_stats_manager_benchmark internal/stats_manager_benchmark.cc stats_core stats_recording absl::memory absl::strings absl::time) +opencensus_benchmark(stats_stats_manager_benchmark + internal/stats_manager_benchmark.cc + stats_core + stats_recording + absl::memory + absl::strings + absl::time) diff --git a/opencensus/tags/CMakeLists.txt b/opencensus/tags/CMakeLists.txt index 8cdc4a8f..dbc4c9bd 100644 --- a/opencensus/tags/CMakeLists.txt +++ b/opencensus/tags/CMakeLists.txt @@ -57,4 +57,7 @@ opencensus_test(tags_with_tag_map_test tags_with_tag_map context) -opencensus_benchmark(tags_tag_map_benchmark internal/tag_map_benchmark.cc tags absl::strings) +opencensus_benchmark(tags_tag_map_benchmark + internal/tag_map_benchmark.cc + tags + absl::strings) diff --git a/opencensus/trace/CMakeLists.txt b/opencensus/trace/CMakeLists.txt index 1fc65450..ecbc107c 100644 --- a/opencensus/trace/CMakeLists.txt +++ b/opencensus/trace/CMakeLists.txt @@ -190,16 +190,28 @@ opencensus_test(trace_with_span_test trace_with_span context) -opencensus_benchmark(trace_attribute_value_ref_benchmark internal/attribute_value_ref_benchmark.cc trace) +opencensus_benchmark(trace_attribute_value_ref_benchmark + internal/attribute_value_ref_benchmark.cc trace) -opencensus_benchmark(trace_cloud_trace_context_benchmark internal/cloud_trace_context_benchmark.cc trace_cloud_trace_context) +opencensus_benchmark(trace_cloud_trace_context_benchmark + internal/cloud_trace_context_benchmark.cc + trace_cloud_trace_context) -opencensus_benchmark(trace_grpc_trace_bin_benchmark internal/grpc_trace_bin_benchmark.cc trace_grpc_trace_bin) +opencensus_benchmark(trace_grpc_trace_bin_benchmark + internal/grpc_trace_bin_benchmark.cc trace_grpc_trace_bin) -opencensus_benchmark(trace_span_benchmark internal/span_benchmark.cc trace_span_context trace) +opencensus_benchmark(trace_span_benchmark + internal/span_benchmark.cc + trace_span_context + trace) -opencensus_benchmark(trace_span_id_benchmark internal/span_id_benchmark.cc trace_span_context) +opencensus_benchmark(trace_span_id_benchmark internal/span_id_benchmark.cc + trace_span_context) -opencensus_benchmark(trace_context_benchmark internal/trace_context_benchmark.cc trace_trace_context) +opencensus_benchmark(trace_context_benchmark internal/trace_context_benchmark.cc + trace_trace_context) -opencensus_benchmark(trace_with_span_benchmark internal/with_span_benchmark.cc trace trace_with_span) +opencensus_benchmark(trace_with_span_benchmark + internal/with_span_benchmark.cc + trace + trace_with_span) From eaf3c3730c05d688a8e5501a5c5f5a260df6f081 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Tue, 2 Apr 2019 17:51:05 +0200 Subject: [PATCH 07/11] Update OpenCensusDeps.cmake --- cmake/OpenCensusDeps.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/OpenCensusDeps.cmake b/cmake/OpenCensusDeps.cmake index 1801ad9c..487b1fe4 100644 --- a/cmake/OpenCensusDeps.cmake +++ b/cmake/OpenCensusDeps.cmake @@ -80,6 +80,9 @@ endif() fetchcontent_getproperties(benchmark) if(NOT benchmark_POPULATED) + set(BENCHMARK_ENABLE_TESTING OFF + CACHE BOOL "Enable testing of the benchmark library." + FORCE) set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE) From f230272d841c2f57541e39251cf95f1e31e4b44e Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Wed, 3 Apr 2019 06:52:57 +0200 Subject: [PATCH 08/11] use explicit commit for abseil --- cmake/OpenCensusDeps.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/OpenCensusDeps.cmake b/cmake/OpenCensusDeps.cmake index 487b1fe4..5bf475ca 100644 --- a/cmake/OpenCensusDeps.cmake +++ b/cmake/OpenCensusDeps.cmake @@ -23,7 +23,7 @@ fetchcontent_declare(abseil GIT_REPOSITORY https://github.com/abseil/abseil-cpp GIT_TAG - master) + 2c8421e1c6cef0da9e8a20b01c15256ec9ec116d) fetchcontent_declare(prometheus GIT_REPOSITORY https://github.com/jupp0r/prometheus-cpp From fbd11b26166ecdf7bb4bf2a120081fd2d8c8be03 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Wed, 3 Apr 2019 19:07:01 +0200 Subject: [PATCH 09/11] fixes based on review --- cmake/OpenCensusHelpers.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake index 5a3b0f5d..e682afbd 100644 --- a/cmake/OpenCensusHelpers.cmake +++ b/cmake/OpenCensusHelpers.cmake @@ -38,16 +38,17 @@ function(opencensus_test NAME SRC) endif() endfunction() -# Helper function like bazel's cc_test. Usage: +# Helper function like bazel's cc_benchmark. Usage: # -# opencensus_benchmark(trace_some_test internal/some_test.cc dep1 dep2...) +# opencensus_benchmark(trace_some_benchmark internal/some_benchmark.cc dep1 dep2...) function(opencensus_benchmark NAME SRC) - # if(BUILD_TESTING) - set(_NAME "opencensus_${NAME}") - add_executable(${_NAME} ${SRC}) - prepend_opencensus(DEPS "${ARGN}") - target_link_libraries(${_NAME} "${DEPS}" benchmark) - # add_test(NAME ${_NAME} COMMAND ${_NAME}) endif() + if(BUILD_TESTING) + set(_NAME "opencensus_${NAME}") + add_executable(${_NAME} ${SRC}) + prepend_opencensus(DEPS "${ARGN}") + target_link_libraries(${_NAME} "${DEPS}" benchmark) + add_test(NAME ${_NAME} COMMAND ${_NAME}) + endif() endfunction() # Helper function like bazel's cc_library. Libraries are namespaced as From b57d2fd5d70c84da9941c5ecd7c545ab3080522c Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Wed, 3 Apr 2019 19:29:35 +0200 Subject: [PATCH 10/11] format --- cmake/OpenCensusHelpers.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake index e682afbd..a6a9c79a 100644 --- a/cmake/OpenCensusHelpers.cmake +++ b/cmake/OpenCensusHelpers.cmake @@ -40,14 +40,15 @@ endfunction() # Helper function like bazel's cc_benchmark. Usage: # -# opencensus_benchmark(trace_some_benchmark internal/some_benchmark.cc dep1 dep2...) +# opencensus_benchmark(trace_some_benchmark internal/some_benchmark.cc dep1 +# dep2...) function(opencensus_benchmark NAME SRC) if(BUILD_TESTING) - set(_NAME "opencensus_${NAME}") - add_executable(${_NAME} ${SRC}) - prepend_opencensus(DEPS "${ARGN}") - target_link_libraries(${_NAME} "${DEPS}" benchmark) - add_test(NAME ${_NAME} COMMAND ${_NAME}) + set(_NAME "opencensus_${NAME}") + add_executable(${_NAME} ${SRC}) + prepend_opencensus(DEPS "${ARGN}") + target_link_libraries(${_NAME} "${DEPS}" benchmark) + add_test(NAME ${_NAME} COMMAND ${_NAME}) endif() endfunction() From 45217225928753604490e6e01a2ae868a2341fb6 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Thu, 4 Apr 2019 18:29:15 +0200 Subject: [PATCH 11/11] removed add_test / CI for benchmarks --- cmake/OpenCensusHelpers.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake index a6a9c79a..5f7b9ce5 100644 --- a/cmake/OpenCensusHelpers.cmake +++ b/cmake/OpenCensusHelpers.cmake @@ -48,7 +48,6 @@ function(opencensus_benchmark NAME SRC) add_executable(${_NAME} ${SRC}) prepend_opencensus(DEPS "${ARGN}") target_link_libraries(${_NAME} "${DEPS}" benchmark) - add_test(NAME ${_NAME} COMMAND ${_NAME}) endif() endfunction()