aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Tingaud <95592999+frederic-tingaud-sonarsource@users.noreply.github.com>2022-07-01 00:30:49 +0200
committerGitHub <noreply@github.com>2022-07-01 00:30:49 +0200
commite76115f1524d10df9b4800580be04881b1478e3a (patch)
tree21c40f9f048031236e3196ce7944213a3c0760ea
parent185c68551209faa3fad6614940522d15d1ae26b6 (diff)
downloadcompiler-explorer-gh-3509.tar.gz
compiler-explorer-gh-3509.zip
Make tools output parsing overridable. (#3819)gh-3509
-rwxr-xr-xlib/tooling/base-tool.js5
-rw-r--r--test/options-handler.js3
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/tooling/base-tool.js b/lib/tooling/base-tool.js
index a12c36d4a..96d21fe70 100755
--- a/lib/tooling/base-tool.js
+++ b/lib/tooling/base-tool.js
@@ -36,6 +36,7 @@ export class BaseTool {
this.env = env;
this.tool.exclude = this.tool.exclude ? this.tool.exclude.split(':') : [];
this.addOptionsToToolArgs = true;
+ this.parseOutput = utils.parseOutput;
}
getId() {
@@ -146,8 +147,8 @@ export class BaseTool {
name: this.tool.name,
code: result.code,
languageId: this.tool.languageId,
- stderr: utils.parseOutput(result.stderr, transformedFilepath, exeDir),
- stdout: utils.parseOutput(result.stdout, transformedFilepath, exeDir),
+ stderr: this.parseOutput(result.stderr, transformedFilepath, exeDir),
+ stdout: this.parseOutput(result.stdout, transformedFilepath, exeDir),
};
}
}
diff --git a/test/options-handler.js b/test/options-handler.js
index 5e4963bd7..c475d27c8 100644
--- a/test/options-handler.js
+++ b/test/options-handler.js
@@ -29,6 +29,7 @@ import _ from 'underscore';
import {BaseCompiler} from '../lib/base-compiler';
import {ClientOptionsHandler} from '../lib/options-handler';
import * as properties from '../lib/properties';
+import {parseOutput} from '../lib/utils';
import {should} from './utils';
@@ -510,6 +511,7 @@ describe('Options handler', () => {
fake: {
faketool: {
addOptionsToToolArgs: true,
+ parseOutput: parseOutput,
tool: {
args: undefined,
compilerLanguage: 'fake',
@@ -527,6 +529,7 @@ describe('Options handler', () => {
},
someothertool: {
addOptionsToToolArgs: true,
+ parseOutput: parseOutput,
tool: {
args: undefined,
compilerLanguage: 'fake',