paleolimbot commented on code in PR #511:
URL: https://github.com/apache/arrow-nanoarrow/pull/511#discussion_r1633352953


##########
ci/scripts/coverage.sh:
##########
@@ -81,11 +81,12 @@ function main() {
 
     # Build + run tests with gcov for IPC extension
     show_header "Build + test nanoarrow_ipc"
-    mkdir "${SANDBOX_DIR}/nanoarrow_ipc"
-    pushd "${SANDBOX_DIR}/nanoarrow_ipc"
+    rm -rf "${SANDBOX_DIR}/nanoarrow"
+    mkdir "${SANDBOX_DIR}/nanoarrow"
+    pushd "${SANDBOX_DIR}/nanoarrow"
 
-    cmake "${TARGET_NANOARROW_DIR}/extensions/nanoarrow_ipc" \
-        -DNANOARROW_IPC_BUILD_TESTS=ON -DNANOARROW_IPC_CODE_COVERAGE=ON
+    cmake "${TARGET_NANOARROW_DIR}" \
+        -DNANOARROW_IPC=ON -DNANOARROW_BUILD_TESTS=ON 
-DNANOARROW_CODE_COVERAGE=ON

Review Comment:
   Does this need to be separate (i.e, can we just add `NANOARROW_IPC=ON` to 
the main nanoarrow coverage call?)



##########
CMakeLists.txt:
##########
@@ -310,10 +433,82 @@ if(NANOARROW_BUILD_TESTS)
   gtest_discover_tests(nanoarrow_hpp_test DISCOVERY_TIMEOUT 10)
   gtest_discover_tests(nanoarrow_testing_test DISCOVERY_TIMEOUT 10)
   gtest_discover_tests(c_data_integration_test DISCOVERY_TIMEOUT 10)
+
+  if(NANOARROW_IPC)
+
+    # zlib to decode gzipped integration testing JSON files
+    # We don't use Arrow C++ for this because building Arrow C++ with zlib
+    # is not trivial on Windows.
+    find_package(ZLIB)
+    if(NOT ZLIB_FOUND)
+      # Wrapper around FetchContent that better isolates the zlib 
CMakeLists.txt
+      message(STATUS "Using FetchContent to build a static zlib")
+      add_subdirectory(thirdparty/zlib)
+    endif()
+
+    enable_testing()
+
+    add_executable(nanoarrow_ipc_decoder_test 
src/nanoarrow/nanoarrow_ipc_decoder_test.cc)
+    add_executable(nanoarrow_ipc_reader_test 
src/nanoarrow/nanoarrow_ipc_reader_test.cc)
+    add_executable(nanoarrow_ipc_files_test 
src/nanoarrow/nanoarrow_ipc_files_test.cc)
+    add_executable(nanoarrow_ipc_hpp_test 
src/nanoarrow/nanoarrow_ipc_hpp_test.cc)
+
+    if(NANOARROW_CODE_COVERAGE)
+      target_compile_options(ipc_coverage_config INTERFACE -O0 -g --coverage)
+      target_link_options(ipc_coverage_config INTERFACE --coverage)
+      target_link_libraries(nanoarrow_ipc PRIVATE ipc_coverage_config)
+    endif()
+    target_link_libraries(nanoarrow_ipc_decoder_test
+                          nanoarrow_ipc
+                          nanoarrow
+                          flatccrt
+                          ${NANOARROW_ARROW_TARGET}
+                          gtest_main
+                          ipc_coverage_config)
+    target_include_directories(nanoarrow_ipc_decoder_test
+                               PUBLIC 
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+                                      $<INSTALL_INTERFACE:include>)

Review Comment:
   Other tests defined in this CMakeLists.txt don't use these generator 
expressions...are they needed?



##########
.gitattributes:
##########
@@ -16,5 +16,4 @@
 # under the License.
 
 dist/* linguist-generated
-extensions/nanoarrow_ipc/thirdparty/* linguist-vendored

Review Comment:
   Should this be changed to `thirdparty/*`?



##########
dev/release/verify-release-candidate.sh:
##########
@@ -246,17 +246,15 @@ test_c() {
   test_cmake_project build . -DNANOARROW_BUILD_TESTS=ON
 
   show_header "Build and test C IPC extension"
-  test_cmake_project build-ipc extensions/nanoarrow_ipc 
-DNANOARROW_IPC_BUILD_TESTS=ON
+  test_cmake_project build . -DNANOARROW_BUILD_TESTS=ON -DNANOARROW_IPC=ON

Review Comment:
   Does this need to be separate (i.e, can we just add `NANOARROW_IPC=ON` to 
the line above it?)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to