Skip to content
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
4 changes: 2 additions & 2 deletions cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ needs_benchmarks = get_option('benchmarks')
needs_csv = get_option('csv')
needs_hdfs = get_option('hdfs')
needs_filesystem = false or needs_hdfs
needs_integration = false
needs_integration = get_option('integration')
needs_tests = get_option('tests')
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
needs_testing = get_option('testing') or needs_tests or needs_benchmarks
needs_testing = get_option('testing') or needs_tests or needs_benchmarks or needs_integration
needs_json = get_option('json') or needs_testing

subdir('src/arrow')
7 changes: 7 additions & 0 deletions cpp/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ option(
value: false,
)

option(
'integration',
type: 'boolean',
description: 'Build the Arrow integration test executables',
value: false,
)

option(
'ipc',
type: 'boolean',
Expand Down
29 changes: 29 additions & 0 deletions cpp/src/arrow/integration/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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.

install_headers(['json_integration.h'])

exc = executable(
'arrow-json-integration-test',
sources: ['json_integration_test.cc'],
dependencies: [arrow_dep, rapidjson_dep, gflags_dep, gtest_dep],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou there is some inconsistency in the tests here that you alluded to before. Most tests do not define a main function and therefore use gtest_main_dep as a dependency. However, this JSON integration test does define its own main, so you have to link just gtest_dep or you end up with duplicate main symbols.

I don't know the history of this test enough to know if it is intentional that some tests define their own main function while others do not. Does it make sense to have two different dependencies or should we consider removing main from this test module?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is intentional. The test is used for an unit test and an integration test with other implementations. If the test is used for an integration test with other implementations, we pass a custom --integration flag. So we have a custom main().

Could you use gtest_dep not gtest_main_dep here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - yes this is already using gtest_dep :-)

link_with: [arrow_test_lib],
)

if needs_tests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case I don't think so - the CMake configuration compiles json_integration_test.cc into an executable, but only makes it a test if ARROW_BUILDS_TESTS is true, leaving it as a standalone executable otherwise.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. We use the executable for integration test too.

test('arrow-json-integration-test', exc)
endif
9 changes: 8 additions & 1 deletion cpp/src/arrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ if needs_csv
arrow_testing_srcs += ['csv/test_common.cc']
endif

if needs_json
if needs_json or needs_integration
rapidjson_dep = dependency('rapidjson', include_type: 'system')
else
rapidjson_dep = disabler()
Expand Down Expand Up @@ -392,11 +392,13 @@ if needs_testing

gtest_dep = dependency('gtest')
gtest_main_dep = dependency('gtest_main')
gtest_dep = dependency('gtest')
gmock_dep = dependency('gmock')
else
filesystem_dep = disabler()
gtest_dep = disabler()
gtest_main_dep = disabler()
gtest_dep = disabler()
gmock_dep = disabler()
endif

Expand Down Expand Up @@ -543,6 +545,11 @@ subdir('c')
subdir('io')
subdir('util')

gflags_dep = dependency('gflags', include_type: 'system')
if needs_integration or needs_tests
subdir('integration')
endif

if needs_csv
subdir('csv')
endif
26 changes: 26 additions & 0 deletions cpp/subprojects/gflags.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz
source_filename = gflags-2.2.2.tar.gz
source_hash = 34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf
directory = gflags-2.2.2
method = cmake

[provide]
gflags = gflags_static_dep