From 993c5f5daedcf7272ea44ac45089145e0e136bfa Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 13 Mar 2025 19:23:18 -0400 Subject: [PATCH] GH-45779: [C++] Add testing directory to Meson configuration --- cpp/meson.build | 1 + cpp/src/arrow/meson.build | 2 + cpp/src/arrow/testing/meson.build | 63 +++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 cpp/src/arrow/testing/meson.build diff --git a/cpp/meson.build b/cpp/meson.build index f855f6218b64..e5a30b0eb41e 100644 --- a/cpp/meson.build +++ b/cpp/meson.build @@ -56,6 +56,7 @@ if git_description == '' git_description = run_command('git', 'describe', '--tags', check: false).stdout().strip() endif +needs_filesystem = false needs_integration = false needs_tests = get_option('tests') needs_ipc = get_option('ipc') or needs_tests diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build index d36754064500..732d20d0cdf9 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -438,4 +438,6 @@ pkg.generate( }, ) +subdir('testing') + subdir('util') diff --git a/cpp/src/arrow/testing/meson.build b/cpp/src/arrow/testing/meson.build new file mode 100644 index 000000000000..d1ebfe2eddbb --- /dev/null +++ b/cpp/src/arrow/testing/meson.build @@ -0,0 +1,63 @@ +# 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( + [ + 'async_test_util.h', + 'builder.h', + 'executor_util.h', + 'extension_type.h', + 'fixed_width_test_util.h', + 'future_util.h', + 'generator.h', + 'gtest_compat.h', + 'gtest_util.h', + 'matchers.h', + 'math.h', + 'pch.h', + 'process.h', + 'random.h', + 'uniform_real.h', + 'util.h', + 'visibility.h', + ], +) + +if needs_tests + testing_tests = { + 'arrow-generator-test': {'sources': ['generator_test.cc']}, + 'arrow-gtest-util-test': {'sources': ['gtest_util_test.cc']}, + 'arrow-random-test': {'sources': ['random_test.cc']}, + } + + foreach key, val : testing_tests + exc = executable( + key, + sources: val['sources'], + dependencies: [arrow_test_dep, val.get('dependencies', [])], + ) + test(key, exc) + endforeach + + if needs_filesystem + library( + 'arrow-filesystem-example', + sources: ['examplefs.cc'], + dependencies: [arrow_dep, gtest_main_dep], + ) + endif +endif