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
5 changes: 0 additions & 5 deletions cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS
# GH-46889: move protobuf_test_util to a more common location
../../../../engine/substrait/protobuf_test_util.cc)

# Resolve segmentation fault error on Windows platform due to Arrow Compute Library Initialization
if(WIN32)
list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_SRCS ../../../../compute/test_env.cc)
endif()

# GH-49651 Link ODBC tests statically on Linux and dynamically on macOS/Windows
if(WIN32 OR APPLE)
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared
Expand Down
12 changes: 12 additions & 0 deletions cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// with windows.h
#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"

#include "arrow/compute/api.h"
#include "arrow/flight/sql/odbc/tests/odbc_test_suite.h"

// For DSN registration
Expand Down Expand Up @@ -82,6 +83,17 @@ class OdbcTestEnvironment : public ::testing::Environment {
}
};

#ifdef _WIN32
// A global test "environment", to ensure Arrow compute kernel functions are registered
class ComputeKernelEnvironment : public ::testing::Environment {
public:
void SetUp() override { ASSERT_OK(arrow::compute::Initialize()); }
};

::testing::Environment* compute_kernel_env =
::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
#endif // _WIN32

Comment thread
justing-bq marked this conversation as resolved.
::testing::Environment* mock_server_env =
::testing::AddGlobalTestEnvironment(new MockServerEnvironment);

Expand Down
Loading