Skip to content

Commit 7b29b24

Browse files
committed
Use git master gflags to avoid valgrind error
Change-Id: Ib36148918bc08435e40edea4f6823c038c8c7075
1 parent f563d3a commit 7b29b24

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

cpp/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,16 @@ if(ARROW_BUILD_TESTS)
518518

519519
set(GFLAGS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gflags_ep-prefix/src/gflags_ep")
520520
ExternalProject_Add(gflags_ep
521-
URL "https://github.com/gflags/gflags/archive/v${GFLAGS_VERSION}.tar.gz"
521+
GIT_REPOSITORY https://github.com/gflags/gflags.git
522+
GIT_TAG cce68f0c9c5d054017425e6e6fd54f696d36e8ee
523+
# URL "https://github.com/gflags/gflags/archive/v${GFLAGS_VERSION}.tar.gz"
522524
BUILD_IN_SOURCE 1
523525
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
524526
-DCMAKE_INSTALL_PREFIX=${GFLAGS_PREFIX}
525527
-DBUILD_SHARED_LIBS=OFF
526528
-DBUILD_STATIC_LIBS=ON
527529
-DBUILD_PACKAGING=OFF
528530
-DBUILD_TESTING=OFF
529-
-DBUILD_NC_TESTS=OFF
530531
-BUILD_CONFIG_TESTS=OFF
531532
-DINSTALL_HEADERS=ON
532533
-DCMAKE_CXX_FLAGS=${GFLAGS_CMAKE_CXX_FLAGS})

cpp/src/arrow/ipc/json-integration-test.cc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ static Status ValidateArrowVsJson(
148148
<< "Arrow schema: \n"
149149
<< arrow_schema->ToString();
150150

151-
if (FLAGS_verbose) {
152-
std::cout << ss.str() << std::endl;
153-
}
151+
if (FLAGS_verbose) { std::cout << ss.str() << std::endl; }
154152
return Status::Invalid("Schemas did not match");
155153
}
156154

@@ -233,8 +231,8 @@ class TestJSONIntegration : public ::testing::Test {
233231
do {
234232
std::shared_ptr<io::FileOutputStream> out;
235233
RETURN_NOT_OK(io::FileOutputStream::Open(path, &out));
236-
RETURN_NOT_OK(out->Write(reinterpret_cast<const uint8_t*>(data),
237-
static_cast<int64_t>(strlen(data))));
234+
RETURN_NOT_OK(out->Write(
235+
reinterpret_cast<const uint8_t*>(data), static_cast<int64_t>(strlen(data))));
238236
} while (0);
239237
return Status::OK();
240238
}
@@ -366,15 +364,18 @@ TEST_F(TestJSONIntegration, ErrorStates) {
366364
int main(int argc, char** argv) {
367365
gflags::ParseCommandLineFlags(&argc, &argv, true);
368366

367+
int ret = 0;
368+
369369
if (FLAGS_integration) {
370370
arrow::Status result = arrow::RunCommand(FLAGS_json, FLAGS_arrow, FLAGS_mode);
371371
if (!result.ok()) {
372372
std::cout << "Error message: " << result.ToString() << std::endl;
373-
return 1;
373+
ret = 1;
374374
}
375375
} else {
376376
::testing::InitGoogleTest(&argc, argv);
377-
return RUN_ALL_TESTS();
377+
ret = RUN_ALL_TESTS();
378378
}
379-
return 0;
379+
gflags::ShutDownCommandLineFlags();
380+
return ret;
380381
}

0 commit comments

Comments
 (0)