Repository navigation
GH-45589: [C++] Enable singular test in Meson configuration #45596
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
Changes from all commits
ee27f9d
7a9142e
631cffe
c438216
b4b615f
bec80f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -227,6 +227,87 @@ arrow_components = { | |||||
| }, | ||||||
| } | ||||||
|
|
||||||
| arrow_testing_srcs = [ | ||||||
| 'io/test_common.cc', | ||||||
| 'ipc/test_common.cc', | ||||||
| 'testing/fixed_width_test_util.cc', | ||||||
| 'testing/generator.cc', | ||||||
| 'testing/gtest_util.cc', | ||||||
| 'testing/math.cc', | ||||||
| 'testing/process.cc', | ||||||
| 'testing/random.cc', | ||||||
| 'testing/util.cc', | ||||||
| ] | ||||||
|
|
||||||
| if needs_integration or needs_tests | ||||||
| arrow_components += { | ||||||
| 'arrow_integration': { | ||||||
| 'sources': [ | ||||||
| 'integration/c_data_integration_internal.cc', | ||||||
| 'integration/json_integration.cc', | ||||||
| 'integration/json_internal.cc', | ||||||
| ], | ||||||
| 'include_dirs': [], | ||||||
| 'dependencies': [], | ||||||
| }, | ||||||
| } | ||||||
| endif | ||||||
|
|
||||||
| if needs_json | ||||||
| rapidjson_dep = dependency('rapidjson', include_type: 'system') | ||||||
| else | ||||||
| rapidjson_dep = disabler() | ||||||
| endif | ||||||
|
|
||||||
| if needs_ipc | ||||||
| arrow_ipc_srcs = [ | ||||||
| 'ipc/dictionary.cc', | ||||||
| 'ipc/feather.cc', | ||||||
| 'ipc/message.cc', | ||||||
| 'ipc/metadata_internal.cc', | ||||||
| 'ipc/options.cc', | ||||||
| 'ipc/reader.cc', | ||||||
| 'ipc/writer.cc', | ||||||
| ] | ||||||
|
|
||||||
| flatbuffers_dep = dependency('flatbuffers') | ||||||
| arrow_ipc_deps = [flatbuffers_dep] | ||||||
|
|
||||||
| if needs_json | ||||||
| arrow_ipc_srcs += 'ipc/json_simple.cc' | ||||||
| arrow_ipc_deps += rapidjson_dep | ||||||
| endif | ||||||
|
|
||||||
| arrow_components += { | ||||||
| 'arrow_ipc': { | ||||||
| 'sources': arrow_ipc_srcs, | ||||||
| 'include_dirs': [], | ||||||
| 'dependencies': arrow_ipc_deps, | ||||||
| }, | ||||||
| } | ||||||
| endif | ||||||
|
|
||||||
| if needs_json | ||||||
| arrow_components += { | ||||||
| 'arrow_json': { | ||||||
| 'sources': [ | ||||||
| 'extension/fixed_shape_tensor.cc', | ||||||
| 'extension/opaque.cc', | ||||||
| 'json/options.cc', | ||||||
| 'json/chunked_builder.cc', | ||||||
| 'json/chunker.cc', | ||||||
| 'json/converter.cc', | ||||||
| 'json/object_parser.cc', | ||||||
| 'json/object_writer.cc', | ||||||
| 'json/parser.cc', | ||||||
| 'json/reader.cc', | ||||||
| ], | ||||||
| 'include_dirs': [], | ||||||
| 'dependencies': [rapidjson_dep], | ||||||
| }, | ||||||
| } | ||||||
| endif | ||||||
|
|
||||||
| arrow_srcs = [] | ||||||
| include_dir = include_directories('..') | ||||||
| arrow_includes = [include_dir] | ||||||
|
|
@@ -289,6 +370,63 @@ install_headers( | |||||
| install_dir: 'arrow', | ||||||
| ) | ||||||
|
|
||||||
| if needs_tests | ||||||
| filesystem_dep = dependency( | ||||||
| 'boost', | ||||||
| modules: ['filesystem'], | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe we need that at the moment. If we do, I think we might need to also have |
||||||
| required: false, | ||||||
| ) | ||||||
| if not filesystem_dep.found() | ||||||
| cmake = import('cmake') | ||||||
| boost_opt = cmake.subproject_options() | ||||||
| boost_opt.add_cmake_defines( | ||||||
| {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'}, | ||||||
| ) | ||||||
| boost_proj = cmake.subproject('boost', options: boost_opt) | ||||||
| filesystem_dep = boost_proj.dependency('boost_filesystem') | ||||||
| endif | ||||||
|
|
||||||
| gtest_main_dep = dependency('gtest_main') | ||||||
| gmock_dep = dependency('gmock') | ||||||
| else | ||||||
| filesystem_dep = disabler() | ||||||
| gtest_main_dep = disabler() | ||||||
| gmock_dep = disabler() | ||||||
| endif | ||||||
|
|
||||||
| arrow_test_lib = static_library( | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The static_library is required here because the Meson wrap dependency for gtest only provides consumers with the source files, and when using that in two different shared libraries then linking together you get an ODR violation. See also mesonbuild/wrapdb#1937 |
||||||
| 'arrow_testing', | ||||||
| sources: arrow_testing_srcs, | ||||||
| include_directories: [include_dir], | ||||||
| link_with: [arrow_lib], | ||||||
| dependencies: [filesystem_dep, gtest_main_dep], | ||||||
| ) | ||||||
|
|
||||||
| arrow_test_dep = declare_dependency( | ||||||
| link_with: [arrow_lib, arrow_test_lib], | ||||||
| include_directories: [include_dir], | ||||||
| dependencies: [filesystem_dep, gmock_dep, gtest_main_dep], | ||||||
| ) | ||||||
|
|
||||||
| array_array_test = executable( | ||||||
| 'arrow_array_test', | ||||||
| sources: [ | ||||||
| 'array/array_test.cc', | ||||||
| 'array/array_binary_test.cc', | ||||||
| 'array/array_dict_test.cc', | ||||||
| 'array/array_list_test.cc', | ||||||
| 'array/array_list_view_test.cc', | ||||||
| 'array/array_run_end_test.cc', | ||||||
| 'array/array_struct_test.cc', | ||||||
| 'array/array_union_test.cc', | ||||||
| 'array/array_view_test.cc', | ||||||
| 'array/statistics_test.cc', | ||||||
| ], | ||||||
| dependencies: [arrow_test_dep], | ||||||
| ) | ||||||
|
|
||||||
| test('arrow_array_test', array_array_test) | ||||||
|
|
||||||
| version = meson.project_version() | ||||||
|
|
||||||
| version_no_snapshot = version.split('-SNAPSHOT')[0] | ||||||
|
|
||||||
| 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. | ||
|
|
||
| [wrap-file] | ||
| source_url = https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-cmake.tar.gz | ||
| source_filename = boost-1.87.0-cmake.tar.gz | ||
| source_hash = 78fbf579e3caf0f47517d3fb4d9301852c3154bfecdc5eeebd9b2b0292366f5b | ||
| directory = boost-1.87.0 | ||
| method = cmake | ||
|
|
||
| [provide] | ||
| boost_filesystem = boost_filesystem_dep | ||
| boost_system = boost_system_dep |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # 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. | ||
|
|
||
| [wrap-file] | ||
| directory = flatbuffers-24.3.6 | ||
| source_url = https://github.com/google/flatbuffers/archive/v24.3.6.tar.gz | ||
| source_filename = flatbuffers-24.3.6.tar.gz | ||
| source_hash = 5d8bfbf5b1b4c47f516e7673677f0e8db0efd32f262f7a14c3fd5ff67e2bd8fc | ||
| patch_filename = flatbuffers_24.3.6-1_patch.zip | ||
| patch_url = https://wrapdb.mesonbuild.com/v2/flatbuffers_24.3.6-1/get_patch | ||
| patch_hash = bc0e1035a67ae74b1f862491fe2b0fd49b2889d989508143fff0a45508421bd7 | ||
| source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/flatbuffers_24.3.6-1/flatbuffers-24.3.6.tar.gz | ||
| wrapdb_version = 24.3.6-1 | ||
|
|
||
| [provide] | ||
| flatbuffers = flatbuffers_dep | ||
| program_names = flatc, flathash |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # 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. | ||
|
|
||
| [wrap-file] | ||
| directory = googletest-1.15.2 | ||
| source_url = https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz | ||
| source_filename = gtest-1.15.2.tar.gz | ||
| source_hash = 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926 | ||
| patch_filename = gtest_1.15.2-1_patch.zip | ||
| patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.15.2-1/get_patch | ||
| patch_hash = b41cba05fc61d47b2ba5bf95732eb86ce2b67303f291b68a9587b7563c318141 | ||
| source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/gtest_1.15.2-1/gtest-1.15.2.tar.gz | ||
| wrapdb_version = 1.15.2-1 | ||
|
|
||
| [provide] | ||
| gtest = gtest_dep | ||
| gtest_main = gtest_main_dep | ||
| gmock = gmock_dep | ||
| gmock_main = gmock_main_dep |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # 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. | ||
|
|
||
| [wrap-file] | ||
| directory = rapidjson-1.1.0 | ||
| source_url = https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz | ||
| source_filename = rapidjson-1.1.0.tar.gz | ||
| source_hash = bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e | ||
| patch_filename = rapidjson_1.1.0-2_patch.zip | ||
| patch_url = https://wrapdb.mesonbuild.com/v2/rapidjson_1.1.0-2/get_patch | ||
| patch_hash = c1480d0ecef09dbaa4b4d85d86090205386fb2c7e87f4f158b20dbbda14c9afc | ||
| source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/rapidjson_1.1.0-2/rapidjson-1.1.0.tar.gz | ||
| wrapdb_version = 1.1.0-2 | ||
|
|
||
| [provide] | ||
| rapidjson = rapidjson_dep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to follow along with the CMake configuration. The option doesn't yet exist in Meson so I've hard-coded for now