From 7077e823ce8624ea2c99a92739cd1516f7c70f78 Mon Sep 17 00:00:00 2001 From: Mate Pek Date: Tue, 23 Nov 2021 08:55:55 +0100 Subject: [PATCH] master: small refactoring --- src/AbstractExecutable.ts | 2 +- src/RunningExecutable.ts | 10 +++++----- src/framework/Catch2Executable.ts | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/AbstractExecutable.ts b/src/AbstractExecutable.ts index a5408ddd..e42bcc8c 100644 --- a/src/AbstractExecutable.ts +++ b/src/AbstractExecutable.ts @@ -693,7 +693,7 @@ export abstract class AbstractExecutable implements Disposable { if (leftBehindBuilder) { debugAssert(!leftBehindBuilder.built, "if it is built it shouldn't be passed"); switch (result.value) { - case ExecutableRunResultValue.Ok: + case ExecutableRunResultValue.OK: { this.shared.log.errorS('builder should not left behind if no problem', this, leftBehindBuilder); leftBehindBuilder.addOutputLine(0, '❗️ Test run has been cancelled by user.'); diff --git a/src/RunningExecutable.ts b/src/RunningExecutable.ts index c1bf7b20..2d52e7ae 100644 --- a/src/RunningExecutable.ts +++ b/src/RunningExecutable.ts @@ -11,7 +11,7 @@ import { assert } from './util/DevelopmentHelper'; /// export enum ExecutableRunResultValue { - Ok, + OK, CancelledByUser, TimeoutByUser, Errored, @@ -23,13 +23,13 @@ export class ExecutableRunResult { private constructor(public readonly value: ExecutableRunResultValue, private readonly _error: string | undefined) {} public get Ok(): boolean { - return this.value === ExecutableRunResultValue.Ok; + return this.value === ExecutableRunResultValue.OK; } public toString(): string { switch (this.value) { - case ExecutableRunResultValue.Ok: - return 'Ok'; + case ExecutableRunResultValue.OK: + return 'Exit(0) / OK'; case ExecutableRunResultValue.CancelledByUser: return 'CancelledByUser'; case ExecutableRunResultValue.TimeoutByUser: @@ -41,7 +41,7 @@ export class ExecutableRunResult { } public static Ok(): ExecutableRunResult { - return new ExecutableRunResult(ExecutableRunResultValue.Ok, undefined); + return new ExecutableRunResult(ExecutableRunResultValue.OK, undefined); } public static Error(message: string): ExecutableRunResult { diff --git a/src/framework/Catch2Executable.ts b/src/framework/Catch2Executable.ts index 63693ff7..6e3f0e44 100644 --- a/src/framework/Catch2Executable.ts +++ b/src/framework/Catch2Executable.ts @@ -243,6 +243,9 @@ export class Catch2Executable extends AbstractExecutable { if (this._catch2Version && this._catch2Version.major >= 3) args.push('--reporter', 'xml'); this.shared.log.info('discovering tests', this.properties.path, args, this.properties.options.cwd); + + //const process = await this.properties.spawner.spawn(this.properties.path, args, this.properties.options); + const catch2TestListOutput = await this.properties.spawner.spawnAsync( this.properties.path, args,