-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Milestone
Description
ToolTest.cc has terrible handling of command-line options:
Lines 37 to 58 in 1d33d2a
| GTEST_API_ int main(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.
Metadata
Metadata
Assignees
Labels
No labels