Commit 76e90947 by Jamie Madill Committed by Commit Bot

Test Runner: Really reuse displays with --bot-mode.

The prior design didn't pass the correct flag to the subprocess. Instead add a new --reuse-displays flag that forces display reuse on in ANGLE tests. Pass the new flag to the child processes when running with --bot-mode. Bug: angleproject:3162 Change-Id: I5f62125d83d339b5e8b2506b4ca4656976f7398e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2419638Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 3f20c713
......@@ -170,11 +170,11 @@ const char *GetColorName(GLColor color)
}
// Always re-use displays when using --bot-mode in the test runner.
bool gBotModeEnabled = false;
bool gReuseDisplays = false;
bool ShouldAlwaysForceNewDisplay()
{
if (gBotModeEnabled)
if (gReuseDisplays)
return false;
// We prefer to reuse config displays. This is faster and solves a driver issue where creating
......@@ -313,7 +313,7 @@ TestPlatformContext gPlatformContext;
constexpr uint32_t kWindowReuseLimit = 50;
constexpr char kUseConfig[] = "--use-config=";
constexpr char kBotMode[] = "--bot-mode";
constexpr char kReuseDisplays[] = "--reuse-displays";
constexpr char kEnableANGLEPerTestCaptureLabel[] = "--angle-per-test-capture-label";
void SetupEnvironmentVarsForCaptureReplay()
......@@ -1358,9 +1358,9 @@ void ANGLEProcessTestArgs(int *argc, char *argv[])
{
SetSelectedConfig(argv[argIndex] + strlen(kUseConfig));
}
if (strncmp(argv[argIndex], kBotMode, strlen(kBotMode)) == 0)
if (strncmp(argv[argIndex], kReuseDisplays, strlen(kReuseDisplays)) == 0)
{
gBotModeEnabled = true;
gReuseDisplays = true;
}
if (strncmp(argv[argIndex], kEnableANGLEPerTestCaptureLabel,
strlen(kEnableANGLEPerTestCaptureLabel)) == 0)
......
......@@ -1030,6 +1030,9 @@ bool TestSuite::launchChildTestProcess(const std::vector<TestIdentifier> &testsI
args.push_back(filterFileArg.c_str());
args.push_back(resultsFileArg.c_str());
// TODO(jmadill): Remove this once migrated. http://anglebug.com/3162
args.push_back("--reuse-displays");
for (const std::string &arg : mGoogleTestCommandLineArgs)
{
args.push_back(arg.c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment