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/+/2419638
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Jamie Madill 2020-09-19 10:48:55 -04:00 коммит произвёл Commit Bot
Родитель 3f20c71388
Коммит 76e90947a8
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -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());