From 4cbc5acf578f7a6310cfdd2acdd0fd5d88c87165 Mon Sep 17 00:00:00 2001 From: Mate Pek Date: Sun, 9 Jan 2022 12:06:56 +0100 Subject: [PATCH] master: GoogleTest fix and gutter change --- src/AbstractExecutable.ts | 14 +++++++----- src/framework/GoogleTestExecutable.ts | 32 +++++++-------------------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/src/AbstractExecutable.ts b/src/AbstractExecutable.ts index 8c864250..ff39354c 100644 --- a/src/AbstractExecutable.ts +++ b/src/AbstractExecutable.ts @@ -8,7 +8,7 @@ import { AbstractTest } from './AbstractTest'; import { TaskPool } from './util/TaskPool'; import { ExecutableRunResultValue, RunningExecutable } from './RunningExecutable'; import { promisify } from 'util'; -import { Version, getAbsolutePath, CancellationToken, reindentStr } from './Util'; +import { Version, getAbsolutePath, CancellationToken, reindentStr, parseLine } from './Util'; import { resolveOSEnvironmentVariables, createPythonIndexerForPathVariable, @@ -186,6 +186,8 @@ export abstract class AbstractExecutable = { resolve: AbstractExecutable._tagVar, rule: '', // will be filled soon enough @@ -250,7 +252,7 @@ export abstract class AbstractExecutable { } }; - // for gtest the source file is only available in the xml output file - let canLoadOutput = true; - for (const [groupingType] of testGroupIterator(this.getTestGrouping())) { - if (groupingType === 'groupBySource') { - canLoadOutput = false; - break; - } - } - try { - if (canLoadOutput) { - await this._reloadFromString(googleTestListProcess.stdout, googleTestListProcess.stderr, cancellationToken); - await loadFromFileIfHas(); - } else { - const closedP = new Promise(r => googleTestListProcess.once('close', r)); - const [stdout, stderr] = await pipeOutputStreams2String( - googleTestListProcess.stdout, - googleTestListProcess.stderr, - ); - await closedP; - const loadedFromFile = await loadFromFileIfHas(); - if (!loadedFromFile) { - await this._reloadFromString(stdout, stderr, cancellationToken); - } + const [stdout, stderr] = await pipeOutputStreams2String( + googleTestListProcess.stdout, + googleTestListProcess.stderr, + ); + const loadedFromFile = await loadFromFileIfHas(); + if (!loadedFromFile) { + await this._reloadFromString(stdout, stderr, cancellationToken); } } catch (e) { this.shared.log.warn('reloadChildren error:', e);