ToolTest.cc has terrible handling of command-line options:
| GTEST_API_intmain(int argc, char** argv) { |
| GOOGLE_PROTOBUF_VERIFY_VERSION; |
| std::cout << "ORC version: " << ORC_VERSION << "\n"; |
| if (argc >= 2) { |
| exampleDirectory = argv[1]; |
| } else { |
| exampleDirectory = "../examples"; |
| } |
| if (argc >= 3) { |
| buildDirectory = argv[2]; |
| } else { |
| buildDirectory = "."; |
| } |
| std::cout << "example dir = " << exampleDirectory << "\n"; |
| if (buildDirectory) { |
| std::cout << "build dir = " << buildDirectory << "\n"; |
| } |
| testing::InitGoogleTest(&argc, argv); |
| int result = RUN_ALL_TESTS(); |
| google::protobuf::ShutdownProtobufLibrary(); |
| return result; |
| } |
First, it interprets argv[1] as exampleDirectory and argv[2] as buildDirectory. Then it passes all options to testing::InitGoogleTest(&argc, argv);
This means that passing optional arguments like --gtest_* does not work. If I do
gtest_filter="-TestMatchParam/FileParam.Contents/19:-TestMatchParam/FileParam.Contents/23"
build/tools/test/tool-test --gtest_filter="$gtest_filter"
then all tests except one fail with an error like
C++ exception with description "Can't open --gtest_filter=-TestMatchParam/FileParam.Contents/19:-TestMatchParam/FileParam.Contents/23/TestOrcFile.testDate2038.orc" thrown in the test body.
ToolTest.cchas terrible handling of command-line options:orc/tools/test/ToolTest.cc
Lines 37 to 58 in 1d33d2a
First, it interprets
argv[1]asexampleDirectoryandargv[2]asbuildDirectory. Then it passes all options totesting::InitGoogleTest(&argc, argv);This means that passing optional arguments like
--gtest_*does not work. If I dothen all tests except one fail with an error like