Log a warning if unrecognized args are passed to the test binary

Bug: none
Change-Id: Ic437dc7656613d9a8088dd51f1ed0713f1992415
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42720
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2021-02-25 20:38:45 +00:00 committed by Commit Bot service account
parent bd3f58612f
commit 7124cc4e5d
2 changed files with 16 additions and 0 deletions

View File

@ -382,6 +382,14 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
"available device type\n";
continue;
}
// Skip over args that look like they're for Googletest.
constexpr const char kGtestArgPrefix[] = "--gtest_";
if (strncmp(kGtestArgPrefix, argv[i], sizeof(kGtestArgPrefix) - 1) == 0) {
continue;
}
dawn::WarningLog() << " Unused argument: " << argv[i];
}
}

View File

@ -43,6 +43,14 @@ void InitDawnValidationTestEnvironment(int argc, char** argv) {
gWireTraceDir = argv[i] + argLen;
continue;
}
// Skip over args that look like they're for Googletest.
constexpr const char kGtestArgPrefix[] = "--gtest_";
if (strncmp(kGtestArgPrefix, argv[i], sizeof(kGtestArgPrefix) - 1) == 0) {
continue;
}
dawn::WarningLog() << " Unused argument: " << argv[i];
}
}