Skip to content

Commit

Permalink
Add turbodbc subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
xhochy committed Aug 30, 2024
1 parent 49b0032 commit c036e82
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 62 deletions.
26 changes: 26 additions & 0 deletions cpp/cpp_odbc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,29 @@ cpp_odbc = static_library(
include_directories: include_directories('Library'),
)

cpp_odbc_test_sources = [
'Test/cpp_odbc_test/level1_mock_api.cpp',
'Test/cpp_odbc_test/level2_mock_api.cpp',
]

cpp_odbc_tests = [
'column_description_test',
'connection_test',
'credentials_test',
'environment_test',
'error_test',
'make_environment_test',
'multi_value_buffer_test',
'statement_test',
]
foreach t: cpp_odbc_tests
e = executable(
t,
cpp_odbc_test_sources + ['Test/tests/' + t + '.cpp'],
dependencies: deps + [gtest, gtest_main, gmock],
link_with: [cpp_odbc],
include_directories: include_directories('Library', 'Test'),
)
test(t, e)
endforeach

98 changes: 98 additions & 0 deletions cpp/turbodbc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
turbodbc = static_library(
'turbodbc',
[
'Library/src/buffer_size.cpp',
'Library/src/column.cpp',
'Library/src/command.cpp',
'Library/src/configuration.cpp',
'Library/src/connect.cpp',
'Library/src/connection.cpp',
'Library/src/cursor.cpp',
'Library/src/description.cpp',
'Library/src/descriptions/boolean_description.cpp',
'Library/src/descriptions/date_description.cpp',
'Library/src/descriptions/floating_point_description.cpp',
'Library/src/descriptions/integer_description.cpp',
'Library/src/descriptions/string_description.cpp',
'Library/src/descriptions/timestamp_description.cpp',
'Library/src/descriptions/unicode_description.cpp',
'Library/src/errors.cpp',
'Library/src/field_translator.cpp',
'Library/src/field_translators/boolean_translator.cpp',
'Library/src/field_translators/date_translator.cpp',
'Library/src/field_translators/float64_translator.cpp',
'Library/src/field_translators/int64_translator.cpp',
'Library/src/field_translators/string_translator.cpp',
'Library/src/field_translators/timestamp_translator.cpp',
'Library/src/make_description.cpp',
'Library/src/make_field_translator.cpp',
'Library/src/parameter.cpp',
'Library/src/parameter_sets/bound_parameter_set.cpp',
'Library/src/parameter_sets/field_parameter_set.cpp',
'Library/src/parameter_sets/set_field.cpp',
'Library/src/result_sets/bound_result_set.cpp',
'Library/src/result_sets/double_buffered_result_set.cpp',
'Library/src/result_sets/field_result_set.cpp',
'Library/src/result_sets/result_set.cpp',
'Library/src/result_sets/row_based_result_set.cpp',
'Library/src/string_helpers.cpp',
'Library/src/time_helpers.cpp',
],
include_directories: include_directories('Library', '../cpp_odbc/Library'),
link_with: [cpp_odbc],
)


turbodbc_test_sources = [
'Test/tests/mock_classes.cpp',
]

turbodbc_tests = [
'parameter_sets/bound_parameter_set_test',
'parameter_sets/set_field_test',
'descriptions/boolean_description_test',
'descriptions/date_description_test',
'descriptions/floating_point_description_test',
'descriptions/integer_description_test',
'descriptions/string_description_test',
'descriptions/timestamp_description_test',
'descriptions/unicode_description_test',
'field_translators/boolean_translator_test',
'field_translators/date_translator_test',
'field_translators/float64_translator_test',
'field_translators/int64_translator_test',
'field_translators/string_translator_test',
'field_translators/timestamp_translator_test',
'result_sets/bound_result_set_test',
# 'result_sets/double_buffered_result_set_test',
'result_sets/field_result_set_test',
'result_sets/result_set_test',
'result_sets/row_based_result_set_test',
'buffer_size_test',
'column_test',
'command_test',
'configuration_test',
'connection_test',
'description_test',
'errors_test',
'field_translator_test',
'make_description_of_description_test',
'make_description_of_type_test',
'make_description_of_value_test',
'make_field_translator_test',
'parameter_test',
'string_helpers_test',
'time_helpers_test',
]

foreach t: turbodbc_tests
e = executable(
t.replace('/', '_'),
turbodbc_test_sources + ['Test/tests/' + t + '.cpp'],
dependencies: [gtest, gtest_main, gmock],
link_with: [turbodbc],
include_directories: include_directories('Library', 'Test', '../cpp_odbc/Library'),
)
test(t, e)
endforeach

64 changes: 2 additions & 62 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -113,44 +113,9 @@ else
endif

subdir('cpp/cpp_odbc')
subdir('cpp/turbodbc')

turbodbc_sources = [
'cpp/turbodbc/Library/src/buffer_size.cpp',
'cpp/turbodbc/Library/src/column.cpp',
'cpp/turbodbc/Library/src/command.cpp',
'cpp/turbodbc/Library/src/configuration.cpp',
'cpp/turbodbc/Library/src/connect.cpp',
'cpp/turbodbc/Library/src/connection.cpp',
'cpp/turbodbc/Library/src/cursor.cpp',
'cpp/turbodbc/Library/src/description.cpp',
'cpp/turbodbc/Library/src/descriptions/boolean_description.cpp',
'cpp/turbodbc/Library/src/descriptions/date_description.cpp',
'cpp/turbodbc/Library/src/descriptions/floating_point_description.cpp',
'cpp/turbodbc/Library/src/descriptions/integer_description.cpp',
'cpp/turbodbc/Library/src/descriptions/string_description.cpp',
'cpp/turbodbc/Library/src/descriptions/timestamp_description.cpp',
'cpp/turbodbc/Library/src/descriptions/unicode_description.cpp',
'cpp/turbodbc/Library/src/errors.cpp',
'cpp/turbodbc/Library/src/field_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/boolean_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/date_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/float64_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/int64_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/string_translator.cpp',
'cpp/turbodbc/Library/src/field_translators/timestamp_translator.cpp',
'cpp/turbodbc/Library/src/make_description.cpp',
'cpp/turbodbc/Library/src/make_field_translator.cpp',
'cpp/turbodbc/Library/src/parameter.cpp',
'cpp/turbodbc/Library/src/parameter_sets/bound_parameter_set.cpp',
'cpp/turbodbc/Library/src/parameter_sets/field_parameter_set.cpp',
'cpp/turbodbc/Library/src/parameter_sets/set_field.cpp',
'cpp/turbodbc/Library/src/result_sets/bound_result_set.cpp',
'cpp/turbodbc/Library/src/result_sets/double_buffered_result_set.cpp',
'cpp/turbodbc/Library/src/result_sets/field_result_set.cpp',
'cpp/turbodbc/Library/src/result_sets/result_set.cpp',
'cpp/turbodbc/Library/src/result_sets/row_based_result_set.cpp',
'cpp/turbodbc/Library/src/string_helpers.cpp',
'cpp/turbodbc/Library/src/time_helpers.cpp',
'cpp/turbodbc_python/Library/src/determine_parameter_type.cpp',
'cpp/turbodbc_python/Library/src/python_bindings/buffer_size.cpp',
'cpp/turbodbc_python/Library/src/python_bindings/column_info.cpp',
Expand Down Expand Up @@ -181,7 +146,7 @@ py.extension_module(
'turbodbc_intern',
turbodbc_sources,
dependencies: deps,
link_with: [cpp_odbc],
link_with: [cpp_odbc, turbodbc],
include_directories: include_directories('cpp/cpp_odbc/Library', 'cpp/turbodbc/Library', 'cpp/turbodbc_python/Library', 'cpp/turbodbc_numpy/Library', 'cpp/turbodbc_arrow/Library'),
install: true
)
Expand All @@ -202,28 +167,3 @@ py.install_sources(
subdir: 'turbodbc',
)

cpp_odbc_test_sources = [
'cpp/cpp_odbc/Test/cpp_odbc_test/level1_mock_api.cpp',
'cpp/cpp_odbc/Test/cpp_odbc_test/level2_mock_api.cpp',
]

cpp_odbc_tests = [
'column_description_test',
'connection_test',
'credentials_test',
'environment_test',
'error_test',
'make_environment_test',
'multi_value_buffer_test',
'statement_test',
]
foreach t: cpp_odbc_tests
e = executable(
t,
cpp_odbc_test_sources + ['cpp/cpp_odbc/Test/tests/' + t + '.cpp'],
dependencies: deps + [gtest, gtest_main, gmock],
link_with: [cpp_odbc],
include_directories: include_directories('cpp/cpp_odbc/Library', 'cpp/cpp_odbc/Test'),
)
test(t, e)
endforeach

0 comments on commit c036e82

Please sign in to comment.