-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,494 additions
and
850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//----------------------------------------------------------------------------- | ||
// vscode-catch2-test-adapter was written by Mate Pek, and is placed in the | ||
// public domain. The author hereby disclaims copyright to this source code. | ||
|
||
import * as cp from 'child_process'; | ||
import * as fs from 'fs'; | ||
|
||
export function spawnAsync( | ||
cmd: string, args?: string[], | ||
options?: cp.SpawnOptions): Promise<cp.SpawnSyncReturns<string>> { | ||
return new Promise((resolve) => { | ||
const command = cp.spawn(cmd, args, options); | ||
const ret: cp.SpawnSyncReturns<string> = { | ||
pid: command.pid, | ||
output: [], | ||
stdout: '', | ||
stderr: '', | ||
status: 0, | ||
signal: '', | ||
error: new Error() | ||
}; | ||
command.stdout.on('data', function(data) { | ||
ret.stdout += data; | ||
ret.output.push(data); | ||
}); | ||
command.on('close', function(code) { | ||
ret.status = code; | ||
resolve(ret) | ||
}); | ||
command.on('error', function(err) { | ||
ret.error = err; | ||
resolve(ret); | ||
}); | ||
}) | ||
} | ||
|
||
export function statSync(path: string): fs.Stats { | ||
return fs.statSync(path); | ||
} | ||
|
||
export function existsSync(path: string): boolean { | ||
return fs.existsSync(path); | ||
} | ||
|
||
export function readdirSync(path: string): string[] { | ||
return fs.readdirSync(path, 'utf8'); | ||
} |
Oops, something went wrong.