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
20 changes: 16 additions & 4 deletions cpp/src/arrow/acero/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ arrow_acero_srcs = [
arrow_acero_lib = library(
'arrow-acero',
sources: arrow_acero_srcs,
dependencies: [arrow_dep],
dependencies: [arrow_compute_dep, arrow_dep],
)

arrow_acero_dep = declare_dependency(link_with: [arrow_acero_lib])

arrow_acero_testing_sources = ['test_nodes.cc', 'test_util_internal.cc'] + arrow_compute_testing_srcs
arrow_acero_testing_sources = ['test_nodes.cc', 'test_util_internal.cc']

arrow_acero_tests = {
'plan-test': {'sources': ['plan_test.cc', 'test_nodes_test.cc']},
Expand All @@ -110,7 +110,7 @@ foreach key, val : arrow_acero_tests
exc = executable(
'arrow-acero-@0@'.format(key),
sources: val['sources'] + arrow_acero_testing_sources,
dependencies: [arrow_acero_dep, arrow_test_dep],
dependencies: [arrow_acero_dep, arrow_compute_test_dep],
)
test(key, exc)
endforeach
Expand All @@ -133,7 +133,19 @@ foreach key, val : arrow_acero_benchmarks
exc = executable(
key,
sources: val['sources'] + arrow_acero_testing_sources,
dependencies: [arrow_acero_dep, arrow_benchmark_dep, gmock_dep],
dependencies: [
arrow_acero_dep,
arrow_compute_test_dep,
arrow_benchmark_dep,
gmock_dep,
],
)
benchmark(key, exc)
endforeach

pkg.generate(
filebase: 'arrow-acero',
name: 'Apache Arrow Acero Engine',
description: 'Apache Arrow\'s Acero Engine',
requires: ['arrow-compute'],
)
8 changes: 7 additions & 1 deletion cpp/src/arrow/c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
# specific language governing permissions and limitations
# under the License.

if needs_compute
arrow_c_bridge_deps = [arrow_compute_test_dep]
else
arrow_c_bridge_deps = [arrow_test_dep]
endif

exc = executable(
'arrow-c-bridge-test',
sources: ['bridge_test.cc'],
dependencies: [arrow_test_dep],
dependencies: arrow_c_bridge_deps,
)
test('arrow-c-bridge-test', exc)

Expand Down
12 changes: 9 additions & 3 deletions cpp/src/arrow/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ if(ARROW_TESTING AND ARROW_COMPUTE)
add_library(arrow_compute_testing OBJECT ${ARROW_COMPUTE_TESTING_SRCS})
# Even though this is still just an object library we still need to "link"
# arrow_compute_core_testing so that is also included correctly
target_link_libraries(arrow_compute_testing
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
PUBLIC ${ARROW_GTEST_GTEST_MAIN})
if(MSVC AND MSVC_VERSION LESS 1930)
target_link_libraries(arrow_compute_testing
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
PUBLIC ${ARROW_GTEST_GTEST_MAIN})
else()
target_link_libraries(arrow_compute_testing
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
PUBLIC ${ARROW_GTEST_GTEST})
endif()
endif()

set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute")
Expand Down
16 changes: 5 additions & 11 deletions cpp/src/arrow/compute/kernels/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ endif

exc = executable(
'arrow-scalar-cast-test',
sources: ['scalar_cast_test.cc'] + arrow_compute_testing_srcs + kernel_testing_srcs,
dependencies: [arrow_test_dep],
sources: ['scalar_cast_test.cc'] + kernel_testing_srcs,
dependencies: [arrow_compute_test_dep],
)
test('arrow-scalar-cast-test', exc)

if needs_compute
arrow_compute_test_dep = declare_dependency(dependencies: [arrow_test_dep])
else
arrow_compute_test_dep = disabler()
endif

# ----------------------------------------------------------------------
# Scalar kernels

Expand Down Expand Up @@ -71,7 +65,7 @@ scalar_kernel_tests = {
foreach key, val : scalar_kernel_tests
exc = executable(
key,
sources: val['sources'] + arrow_compute_testing_srcs + kernel_testing_srcs,
sources: val['sources'] + kernel_testing_srcs,
dependencies: [arrow_compute_test_dep],
)
test(key, exc)
Expand Down Expand Up @@ -126,7 +120,7 @@ vector_kernel_tests = {
foreach key, val : vector_kernel_tests
exc = executable(
key,
sources: val['sources'] + arrow_compute_testing_srcs + kernel_testing_srcs,
sources: val['sources'] + kernel_testing_srcs,
dependencies: [arrow_compute_test_dep],
)
test(key, exc)
Expand Down Expand Up @@ -157,7 +151,7 @@ endforeach
# Aggregates
exc = executable(
'arrow-compute-aggregate-test',
sources: ['aggregate_test.cc'] + arrow_compute_testing_srcs + kernel_testing_srcs,
sources: ['aggregate_test.cc'] + kernel_testing_srcs,
dependencies: [arrow_compute_test_dep, filesystem_dep],
)
test('arrow-compute-aggregate-test', exc)
Expand Down
69 changes: 49 additions & 20 deletions cpp/src/arrow/compute/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,48 @@ install_headers(
if needs_compute
pkg.generate(
filebase: 'arrow-compute',
name: 'Apache Arrow Compute',
description: 'All compute kernels for Apache Arrow',
name: 'Apache Arrow Compute Kernels',
description: 'Apache Arrow\'s Compute Kernels',
requires: ['arrow'],
)
endif

arrow_compute_testing_srcs = []
# Define arrow_compute_core_testing object library for common test files requiring
# only core compute. No extra kernels are required.
if needs_testing
arrow_compute_testing_srcs += files('test_util_internal.cc')
arrow_compute_core_test_lib = library(
'arrow-compute-core-testing',
sources: files('test_util_internal.cc'),
dependencies: arrow_test_dep,
)
arrow_compute_core_test_dep = declare_dependency(
link_with: arrow_compute_core_test_lib,
)
else
arrow_compute_core_test_dep = disabler()
endif

# Define arrow_compute_testing object library for test files requiring extra kernels.
if needs_testing and needs_compute
arrow_compute_testing_lib = library(
'arrow-compute-testing',
sources: files('test_env.cc'),
dependencies: [
arrow_compute_dep,
arrow_compute_core_test_dep,
arrow_test_dep_no_main,
],
)
arrow_compute_test_dep = declare_dependency(
link_with: arrow_compute_testing_lib,
dependencies: [
arrow_compute_dep,
arrow_compute_core_test_dep,
arrow_test_dep_no_main,
],
)
else
arrow_compute_test_dep = disabler()
endif

exc = executable(
Expand All @@ -59,15 +92,13 @@ exc = executable(
'exec_test.cc',
'kernel_test.cc',
'registry_test.cc',
] + arrow_compute_testing_srcs,
dependencies: [arrow_test_dep],
],
dependencies: [arrow_compute_core_test_dep, arrow_test_dep],
)
test('arrow-internals-test', exc)

compute_tests = {
'arrow-compute-expression-test': {
'sources': ['expression_test.cc'] + arrow_compute_testing_srcs,
},
'arrow-compute-expression-test': {'sources': ['expression_test.cc']},
'arrow-compute-row-test': {
'sources': [
'key_hash_test.cc',
Expand All @@ -77,7 +108,7 @@ compute_tests = {
'row/row_encoder_internal_test.cc',
'row/row_test.cc',
'util_internal_test.cc',
] + arrow_compute_testing_srcs,
],
},
}

Expand All @@ -96,16 +127,14 @@ compute_tests = {
# - value_counts
#
# Also see: GH-34388, GH-34615
if needs_compute
foreach key, val : compute_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep],
)
test(key, exc)
endforeach
endif
foreach key, val : compute_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_compute_test_dep],
)
test(key, exc)
endforeach

exc = executable(
'arrow-compute-function-benchmark',
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/row/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ if needs_compute
exc = executable(
'arrow-compute-grouper-benchmark',
sources: ['grouper_benchmark.cc'],
dependencies: [arrow_benchmark_dep],
dependencies: [arrow_compute_dep, arrow_benchmark_dep],
)
endif
10 changes: 10 additions & 0 deletions cpp/src/arrow/compute/test_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,18 @@ class ComputeKernelEnvironment : public ::testing::Environment {

} // namespace

#if defined(_MSC_VER) && _MSC_VER < 1930
// Initialize the compute module
::testing::Environment* compute_kernels_env =
::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
#endif

} // namespace arrow::compute

#if !(defined(_MSC_VER) && _MSC_VER < 1930)
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::AddGlobalTestEnvironment(new arrow::compute::ComputeKernelEnvironment);
return RUN_ALL_TESTS();
}
#endif
Loading
Loading