diff options
author | Partouf <partouf@gmail.com> | 2018-03-15 18:30:31 +0100 |
---|---|---|
committer | Partouf <partouf@gmail.com> | 2018-03-15 18:30:31 +0100 |
commit | f16c7bb7f3c774764e42dc3d97504b45f9c0e514 (patch) | |
tree | d54149dcf2a21c3d115593762d0ead4dc48538ec /lib/compilers/pascal.js | |
parent | a58689b66413b47d9c2f80d778f69fd15f9ae9e1 (diff) | |
download | compiler-explorer-f16c7bb7f3c774764e42dc3d97504b45f9c0e514.tar.gz compiler-explorer-f16c7bb7f3c774764e42dc3d97504b45f9c0e514.zip |
refactor to add extra test
Diffstat (limited to 'lib/compilers/pascal.js')
-rw-r--r-- | lib/compilers/pascal.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/compilers/pascal.js b/lib/compilers/pascal.js index f67cfba6c..182ca2a9d 100644 --- a/lib/compilers/pascal.js +++ b/lib/compilers/pascal.js @@ -129,14 +129,18 @@ class FPCCompiler extends BaseCompiler { options.push(projectFile); return this.exec(compiler, options, execOptions).then(result => { - const fileWithoutPath = path.basename(inputFilename); - result.inputFilename = fileWithoutPath; - result.stdout = utils.parseOutput(result.stdout, fileWithoutPath, tempPath); - result.stderr = utils.parseOutput(result.stderr, fileWithoutPath, tempPath); - return result; + return this.parseOutput(result, inputFilename, tempPath); }); } + parseOutput(result, inputFilename, tempPath) { + const fileWithoutPath = path.basename(inputFilename); + result.inputFilename = fileWithoutPath; + result.stdout = utils.parseOutput(result.stdout, fileWithoutPath, tempPath); + result.stderr = utils.parseOutput(result.stderr, fileWithoutPath, tempPath); + return result; + } + execBinary(executable, result, maxSize) { executable = path.join(path.dirname(executable), "prog"); |