Skip to content

Commit

Permalink
master: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Pek committed Feb 22, 2022
1 parent 646c9c4 commit acabb8b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [4.0.26]

### Changed

- improvements to the built-in default search pattern for waitForBuildProcess
Expand Down
2 changes: 1 addition & 1 deletion documents/configuration/test.advancedExecutables.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ If it is an object it can contains the following properties:
| `parallelizationLimit` | The variable maximize the number of the parallel execution of one executable instance. Note: `testMate.cpp.test.parallelExecutionLimit` is a global limit. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `strictPattern` | Test loading fails if one of the files matched by `pattern` is not a test executable. (Helps noticing unexpected crashes/problems under test loading.) |
| `markAsSkipped` | If true then all the tests related to the pattern are skipped. They can be run manually though. |
| `waitForBuildProcess` | (experimental) Prevents the extension of auto-reloading. With this linking failure might can be avoided. |
| `waitForBuildProcess` | (experimental) Prevents the extension of auto-reloading. With this linking failure might can be avoided. Can be true to use a default pattern that works for most cases, or a string to pass your own search pattern (regex) for processes. |
| `catch2` | Object with framework specific settings. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md#framework-specific-settings) |
| `gtest` | Object with framework specific settings. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md#framework-specific-settings) |
| `doctest` | Object with framework specific settings. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md#framework-specific-settings) |
Expand Down
6 changes: 1 addition & 5 deletions src/ConfigOfExecGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,7 @@ export class ConfigOfExecGroup implements vscode.Disposable {
}

if (isFileExistsAndExecutable) {
if (this._waitForBuildProcess) {
await this._shared.buildProcessChecker.resolveAtFinish(
typeof this._waitForBuildProcess === 'string' ? this._waitForBuildProcess : undefined,
);
}
await this._shared.buildProcessChecker.resolveAtFinish(this._waitForBuildProcess);

try {
await executable.reloadTests(this._shared.taskPool, this._shared.cancellationToken);
Expand Down
8 changes: 5 additions & 3 deletions src/util/BuildProcessChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export class BuildProcessChecker {
this._finishedResolver();
}

resolveAtFinish(pattern: string | undefined): Promise<void> {
resolveAtFinish(pattern: string | boolean | undefined): Promise<void> {
if (pattern === false) return Promise.resolve();

if (this._timerId !== undefined) {
return this._finishedP;
}
Expand All @@ -36,8 +38,8 @@ export class BuildProcessChecker {
this._finishedResolver = r;
});

this._log.info('Checking running build related processes');
const patternToUse = pattern ? RegExp(pattern) : this._defaultPattern;
const patternToUse = typeof pattern == 'string' ? RegExp(pattern) : this._defaultPattern;
this._log.info('Checking running build related processes', patternToUse);
this._timerId = global.setInterval(this._refresh.bind(this, patternToUse), this._checkIntervalMillis);
this._refresh(patternToUse);

Expand Down

0 comments on commit acabb8b

Please sign in to comment.