From af5c33bbbfec2bea7079653282a37364540a18c4 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Fri, 4 Mar 2016 15:32:14 +0000 Subject: [PATCH] test: Only pass unused args to GoogleTest --- test/ares-test-main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/ares-test-main.cc b/test/ares-test-main.cc index 329d34d8..0859a0ee 100644 --- a/test/ares-test-main.cc +++ b/test/ares-test-main.cc @@ -4,15 +4,19 @@ #include "ares-test.h" int main(int argc, char* argv[]) { - ::testing::InitGoogleTest(&argc, argv); + std::vector gtest_argv = {argv[0]}; for (int ii = 1; ii < argc; ii++) { if (strcmp(argv[ii], "-v") == 0) { ares::test::verbose = true; } else if ((strcmp(argv[ii], "-p") == 0) && (ii + 1 < argc)) { ii++; ares::test::mock_port = atoi(argv[ii]); + } else { + gtest_argv.push_back(argv[ii]); } } + int gtest_argc = gtest_argv.size(); + ::testing::InitGoogleTest(>est_argc, gtest_argv.data()); #ifdef WIN32 WORD wVersionRequested = MAKEWORD(2, 2);