This is an automated email from the ASF dual-hosted git repository.
paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git
The following commit(s) were added to refs/heads/main by this push:
new 397cfc5f refactor: Simplify Meson test generation (#525)
397cfc5f is described below
commit 397cfc5fccffb1ef71693b76069983cc5c311842
Author: William Ayd <[email protected]>
AuthorDate: Thu Jun 13 22:19:05 2024 -0400
refactor: Simplify Meson test generation (#525)
---
src/nanoarrow/meson.build | 93 +++++++++++++++++++----------------------------
1 file changed, 38 insertions(+), 55 deletions(-)
diff --git a/src/nanoarrow/meson.build b/src/nanoarrow/meson.build
index e96d98b1..cdbd6ed0 100644
--- a/src/nanoarrow/meson.build
+++ b/src/nanoarrow/meson.build
@@ -104,64 +104,47 @@ if get_option('tests')
gmock_dep = dependency('gmock')
nlohmann_json_dep = dependency('nlohmann_json')
- utils_test = executable('utils_test', 'utils_test.cc',
- link_with: nanoarrow_lib,
- dependencies: [
- arrow_dep,
- gtest_dep,
- gmock_dep,
- nlohmann_json_dep,
- ],
- include_directories: incdir)
- test('utils test', utils_test)
-
- buffer_test = executable('buffer_test', 'buffer_test.cc',
- dependencies: [arrow_dep, gtest_dep],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('buffer test', buffer_test)
-
- array_test = executable('array_test', 'array_test.cc',
- dependencies: [arrow_dep, gtest_dep, gmock_dep],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('array test', array_test)
-
- schema_test = executable('schema_test', 'schema_test.cc',
- dependencies: [arrow_dep, gtest_dep],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('schema test', schema_test)
-
- array_stream_test = executable('array_stream_test', 'array_stream_test.cc',
- dependencies: [arrow_dep, gtest_dep,
gmock_dep],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('array_stream test', array_stream_test)
-
- nanoarrow_hpp_test = executable('nanoarrow_hpp_test',
'nanoarrow_hpp_test.cc',
- dependencies: [
- arrow_dep,
- gtest_dep,
- gmock_dep,
- nlohmann_json_dep,
- ],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('nanoarrow_hpp test', nanoarrow_hpp_test)
-
- nanoarrow_testing_test = executable('nanoarrow_testing_test',
'nanoarrow_testing_test.cc',
- dependencies: [arrow_dep, gtest_dep,
nlohmann_json_dep],
- link_with: nanoarrow_lib,
- include_directories: incdir)
- test('nanoarrow_testing test', nanoarrow_testing_test)
-
-
- c_data_integration_test = executable('c_data_integration_test',
'integration/c_data_integration_test.cc',
+ nanoarrow_tests = {
+ 'utils': {
+ 'deps': [arrow_dep, gtest_dep, gmock_dep, nlohmann_json_dep],
+ },
+ 'buffer': {
+ 'deps': [arrow_dep, gtest_dep],
+ },
+ 'array': {
+ 'deps': [arrow_dep, gtest_dep, gmock_dep],
+ },
+ 'schema': {
+ 'deps': [arrow_dep, gtest_dep],
+ },
+ 'array-stream': {
+ 'deps': [arrow_dep, gtest_dep, gmock_dep],
+ },
+ 'nanoarrow-hpp': {
+ 'deps': [arrow_dep, gtest_dep, gmock_dep, nlohmann_json_dep],
+ },
+ 'nanoarrow-testing': {
+ 'deps': [arrow_dep, gtest_dep, nlohmann_json_dep],
+ },
+ }
+
+ foreach name, config : nanoarrow_tests
+ exc = executable(
+ name + '-test',
+ sources: name.replace('-', '_') + '_test.cc',
+ link_with: nanoarrow_lib,
+ include_directories: incdir,
+ dependencies: config['deps'],
+ )
+ test(name, exc)
+ endforeach
+
+ c_data_integration_test = executable('c-data-integration-test',
+
'integration/c_data_integration_test.cc',
link_with: c_data_integration_lib,
dependencies: [arrow_dep, gtest_dep],
include_directories: incdir)
- test('c_data_integration test', c_data_integration_test)
+ test('c-data-integration', c_data_integration_test)
if get_option('ipc')
zlib_dep = dependency('zlib')