Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(extensions/nanoarrow_testing): Add nanoarrow_testing extension with testing JSON writer #317

Merged
merged 26 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,17 @@ if(NANOARROW_BUNDLE)
"${SRC_FILE_CONTENTS}")
file(WRITE ${NANOARROW_H_TEMP} "${SRC_FILE_CONTENTS}")

# Copy nanoarrow.hpp too
# Copy nanoarrow.hpp
set(NANOARROW_HPP_TEMP ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow.hpp)
file(READ src/nanoarrow/nanoarrow.hpp SRC_FILE_CONTENTS)
file(WRITE ${NANOARROW_HPP_TEMP} "${SRC_FILE_CONTENTS}")

# Copy nanoarrow_testing.hpp
set(NANOARROW_TESTING_HPP_TEMP
${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow_testing.hpp)
file(READ src/nanoarrow/nanoarrow_testing.hpp SRC_FILE_CONTENTS)
file(WRITE ${NANOARROW_TESTING_HPP_TEMP} "${SRC_FILE_CONTENTS}")

# Combine all source files into amalgamation/nanoarrow.c in the build directory
if(NANOARROW_BUNDLE_AS_CPP)
set(NANOARROW_C_TEMP ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow.cc)
Expand All @@ -100,7 +106,7 @@ if(NANOARROW_BUNDLE)

# Install the amalgamated header and source
install(FILES ${NANOARROW_H_TEMP} ${NANOARROW_C_TEMP} ${NANOARROW_HPP_TEMP}
DESTINATION ".")
${NANOARROW_TESTING_HPP_TEMP} DESTINATION ".")
else()
add_library(nanoarrow src/nanoarrow/array.c src/nanoarrow/schema.c
src/nanoarrow/array_stream.c src/nanoarrow/utils.c)
Expand Down Expand Up @@ -203,6 +209,7 @@ if(NANOARROW_BUILD_TESTS)
add_executable(schema_test src/nanoarrow/schema_test.cc)
add_executable(array_stream_test src/nanoarrow/array_stream_test.cc)
add_executable(nanoarrow_hpp_test src/nanoarrow/nanoarrow_hpp_test.cc)
add_executable(nanoarrow_testing_test src/nanoarrow/nanoarrow_testing_test.cc)

if(NANOARROW_CODE_COVERAGE)
target_compile_options(coverage_config INTERFACE -O0 -g --coverage)
Expand All @@ -228,6 +235,7 @@ if(NANOARROW_BUILD_TESTS)
coverage_config)
target_link_libraries(array_stream_test nanoarrow gtest_main coverage_config)
target_link_libraries(nanoarrow_hpp_test nanoarrow gtest_main coverage_config)
target_link_libraries(nanoarrow_testing_test nanoarrow gtest_main coverage_config)

include(GoogleTest)
# Some users have reported a timeout with the default value of 5
Expand All @@ -239,4 +247,5 @@ if(NANOARROW_BUILD_TESTS)
gtest_discover_tests(schema_test DISCOVERY_TIMEOUT 10)
gtest_discover_tests(array_stream_test DISCOVERY_TIMEOUT 10)
gtest_discover_tests(nanoarrow_hpp_test DISCOVERY_TIMEOUT 10)
gtest_discover_tests(nanoarrow_testing_test DISCOVERY_TIMEOUT 10)
endif()
1 change: 1 addition & 0 deletions docs/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ API Reference
R API Reference <r>
C API Reference <c>
C++ API Reference <cpp>
Testing API Reference <testing>
IPC Extension Reference <ipc>
Device Extension Reference <device>
27 changes: 27 additions & 0 deletions docs/source/reference/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. Licensed to the Apache Software Foundation (ASF) under one
.. or more contributor license agreements. See the NOTICE file
.. distributed with this work for additional information
.. regarding copyright ownership. The ASF licenses this file
.. to you 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.

Teseting API Reference
======================

.. doxygengroup:: nanoarrow_testing

Integration testing JSON
------------------------

.. doxygengroup:: nanoarrow_testing-json
:members:
Loading
Loading