This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new b1ce6527 fix(c/driver/postgresql): Allow ctest to run benchmark (#1203)
b1ce6527 is described below
commit b1ce6527dc1001c79122b3c8aef9cc7a81e830b8
Author: William Ayd <[email protected]>
AuthorDate: Fri Oct 20 10:29:43 2023 -0400
fix(c/driver/postgresql): Allow ctest to run benchmark (#1203)
Previously the add_benchmark CMake function would create the benchmark
which could be invoked directly without issue. However, the `ctest`
invocation would not yield results
---
c/cmake_modules/BuildUtils.cmake | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/c/cmake_modules/BuildUtils.cmake b/c/cmake_modules/BuildUtils.cmake
index de1a7b2a..88209ac5 100644
--- a/c/cmake_modules/BuildUtils.cmake
+++ b/c/cmake_modules/BuildUtils.cmake
@@ -457,7 +457,7 @@ function(ADD_BENCHMARK REL_BENCHMARK_NAME)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${REL_BENCHMARK_NAME}.cc)
# This benchmark has a corresponding .cc file, set it up as an executable.
- set(BENCHMARK_PATH "${EXECUTABLE_OUTPUT_PATH}/${BENCHMARK_NAME}")
+ set(BENCHMARK_PATH "${CMAKE_CURRENT_BINARY_DIR}/${BENCHMARK_NAME}")
add_executable(${BENCHMARK_NAME} ${SOURCES})
if(ARG_STATIC_LINK_LIBS)
@@ -467,7 +467,6 @@ function(ADD_BENCHMARK REL_BENCHMARK_NAME)
target_link_libraries(${BENCHMARK_NAME} PRIVATE
${ADBC_BENCHMARK_LINK_LIBS})
endif()
add_dependencies(benchmark ${BENCHMARK_NAME})
- set(NO_COLOR "--color_print=false")
if(ARG_EXTRA_LINK_LIBS)
target_link_libraries(${BENCHMARK_NAME} PRIVATE ${ARG_EXTRA_LINK_LIBS})
@@ -475,7 +474,6 @@ function(ADD_BENCHMARK REL_BENCHMARK_NAME)
else()
# No executable, just invoke the benchmark (probably a script) directly.
set(BENCHMARK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${REL_BENCHMARK_NAME})
- set(NO_COLOR "")
endif()
# With OSX and conda, we need to set the correct RPATH so that dependencies
@@ -515,8 +513,7 @@ function(ADD_BENCHMARK REL_BENCHMARK_NAME)
${BUILD_SUPPORT_DIR}/run-test.sh
${CMAKE_BINARY_DIR}
benchmark
- ${BENCHMARK_PATH}
- ${NO_COLOR})
+ ${BENCHMARK_PATH})
set_property(TEST ${BENCHMARK_NAME}
APPEND
PROPERTY LABELS ${ARG_LABELS})