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
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ endif()
# the first link library. It's for prioritizing bundled FlatBuffers
# than system FlatBuffers.
list(PREPEND ARROW_TEST_LINK_LIBS arrow::flatbuffers)
list(APPEND ARROW_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK} ${ARROW_GTEST_GTEST_MAIN})
list(APPEND ARROW_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK_MAIN})

if(ARROW_BUILD_BENCHMARKS)
set(ARROW_BENCHMARK_LINK_LIBS benchmark::benchmark_main ${ARROW_TEST_LINK_LIBS})
Expand Down
2 changes: 2 additions & 0 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2428,13 +2428,15 @@ if(ARROW_TESTING)
set(ARROW_GTEST_GMOCK GTest::gmock)
set(ARROW_GTEST_GTEST GTest::gtest)
set(ARROW_GTEST_GTEST_MAIN GTest::gtest_main)
set(ARROW_GTEST_GMOCK_MAIN GTest::gmock_main)
else()
string(APPEND ARROW_TESTING_PC_CFLAGS " -I\${includedir}/arrow-gtest")
string(APPEND ARROW_TESTING_PC_LIBS " -larrow_gtest")
set(ARROW_GTEST_GTEST_HEADERS arrow::GTest::gtest_headers)
set(ARROW_GTEST_GMOCK arrow::GTest::gmock)
set(ARROW_GTEST_GTEST arrow::GTest::gtest)
set(ARROW_GTEST_GTEST_MAIN arrow::GTest::gtest_main)
set(ARROW_GTEST_GMOCK_MAIN arrow::GTest::gmock_main)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ if(ARROW_ENABLE_THREADING)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS Threads::Threads)
endif()

set(ARROW_TEST_LINK_TOOLCHAIN ${ARROW_GTEST_GMOCK} ${ARROW_GTEST_GTEST_MAIN})
set(ARROW_TEST_LINK_TOOLCHAIN ${ARROW_GTEST_GMOCK_MAIN})
set(ARROW_TEST_STATIC_LINK_LIBS arrow::flatbuffers arrow_testing_static arrow_static
${ARROW_TEST_LINK_TOOLCHAIN})
set(ARROW_TEST_SHARED_LINK_LIBS arrow::flatbuffers arrow_testing_shared arrow_shared
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/adapters/orc/adapter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@ TEST(TestAdapterReadWrite, ThrowWhenTZDBUnavaiable) {
if (adapters::orc::GetOrcMajorVersion() >= 2) {
GTEST_SKIP() << "Only ORC pre-2.0.0 versions have the time zone database check";
}
#ifdef _WIN32
GTEST_SKIP() << "GH-47489: Expected error is not thrown on Windows";
#endif

EnvVarGuard tzdir_guard("TZDIR", "/wrong/path");
const char* expect_str = "IANA time zone database is unavailable but required by ORC";
Expand Down
12 changes: 3 additions & 9 deletions cpp/src/arrow/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,9 @@ 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
if(MSVC)
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()
target_link_libraries(arrow_compute_testing
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
PUBLIC ${ARROW_GTEST_GTEST})
endif()

set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute")
Expand Down
9 changes: 0 additions & 9 deletions cpp/src/arrow/compute/test_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ class ComputeKernelEnvironment : public ::testing::Environment {
};

} // namespace

#ifdef _MSC_VER
// Initialize the compute module
::testing::Environment* compute_kernels_env =
::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
#endif

} // namespace arrow::compute

#ifndef _MSC_VER
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::AddGlobalTestEnvironment(new arrow::compute::ComputeKernelEnvironment);
return RUN_ALL_TESTS();
}
#endif
4 changes: 4 additions & 0 deletions cpp/src/arrow/engine/substrait/serde_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,10 @@ NamedTableProvider AlwaysProvideSameTable(std::shared_ptr<Table> table) {
}

TEST(Substrait, ExecReadRelWithLocalFiles) {
#ifdef _WIN32
GTEST_SKIP()
<< "GH-47490: Substrait does not properly parse PARQUET_TEST_DATA path on Windows";
#endif
ASSERT_OK_AND_ASSIGN(std::string dir_string,
arrow::internal::GetEnvVar("PARQUET_TEST_DATA"));

Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/testing/gtest_util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,12 @@ TEST(TestWithinUlp, Float) {
TEST(AssertTestWithinUlp, Basics) {
AssertWithinUlp(123.4567, 123.45670000000015, 11);
AssertWithinUlp(123.456f, 123.456085f, 11);
#ifndef _WIN32
// GH-47442
EXPECT_FATAL_FAILURE(AssertWithinUlp(123.4567, 123.45670000000015, 10),
"not within 10 ulps");
EXPECT_FATAL_FAILURE(AssertWithinUlp(123.456f, 123.456085f, 10), "not within 10 ulps");
#endif
}

} // namespace arrow
4 changes: 2 additions & 2 deletions cpp/src/gandiva/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ if(WIN32)
list(APPEND GANDIVA_STATIC_TEST_LINK_LIBS ${GANDIVA_OPENSSL_LIBS})
list(APPEND GANDIVA_SHARED_TEST_LINK_LIBS ${GANDIVA_OPENSSL_LIBS})
endif()
list(APPEND GANDIVA_STATIC_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK} ${ARROW_GTEST_GTEST_MAIN})
list(APPEND GANDIVA_SHARED_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK} ${ARROW_GTEST_GTEST_MAIN})
list(APPEND GANDIVA_STATIC_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK_MAIN})
list(APPEND GANDIVA_SHARED_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK_MAIN})

function(ADD_GANDIVA_TEST REL_TEST_NAME)
set(options USE_STATIC_LINKING)
Expand Down
Loading