Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit fbd11b2

Browse files
committed
fixes based on review
1 parent f230272 commit fbd11b2

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

cmake/OpenCensusHelpers.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ function(opencensus_test NAME SRC)
3838
endif()
3939
endfunction()
4040

41-
# Helper function like bazel's cc_test. Usage:
41+
# Helper function like bazel's cc_benchmark. Usage:
4242
#
43-
# opencensus_benchmark(trace_some_test internal/some_test.cc dep1 dep2...)
43+
# opencensus_benchmark(trace_some_benchmark internal/some_benchmark.cc dep1 dep2...)
4444
function(opencensus_benchmark NAME SRC)
45-
# if(BUILD_TESTING)
46-
set(_NAME "opencensus_${NAME}")
47-
add_executable(${_NAME} ${SRC})
48-
prepend_opencensus(DEPS "${ARGN}")
49-
target_link_libraries(${_NAME} "${DEPS}" benchmark)
50-
# add_test(NAME ${_NAME} COMMAND ${_NAME}) endif()
45+
if(BUILD_TESTING)
46+
set(_NAME "opencensus_${NAME}")
47+
add_executable(${_NAME} ${SRC})
48+
prepend_opencensus(DEPS "${ARGN}")
49+
target_link_libraries(${_NAME} "${DEPS}" benchmark)
50+
add_test(NAME ${_NAME} COMMAND ${_NAME})
51+
endif()
5152
endfunction()
5253

5354
# Helper function like bazel's cc_library. Libraries are namespaced as

0 commit comments

Comments
 (0)