blob: 0dd0553acd9a1a3fa88269cd0507117240c138ce (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
// expose either extension server host as a stdin/stdout process for focused tests.
const fs = require('fs');
const path = require('path');
const target = path.resolve(process.argv[2]);
const { wasmProcess } = require('../../editors/vscode/client/wasmproc');
const { vmProcess } = require('../../editors/vscode/client/vmproc');
const server = target.endsWith('.wasm') ? wasmProcess(target) : vmProcess(target);
server.stdout.on('data', bytes => process.stdout.write(bytes));
server.stderr.on('data', bytes => process.stderr.write(bytes));
server.on('exit', status => { if (status !== 0) process.exitCode = 1; });
server.stdin.write(fs.readFileSync(0));
|