2018-08-03 17:18:42 +00:00
|
|
|
// ============
|
|
|
|
// combines different tap test files to an overall result
|
|
|
|
// ============
|
|
|
|
import * as plugins from './tstest.plugins';
|
|
|
|
|
2018-08-04 12:23:07 +00:00
|
|
|
export class TapTestResult {
|
|
|
|
testLogBuffer = Buffer.from('');
|
|
|
|
testOk: boolean = false;
|
|
|
|
testSettled: boolean = false;
|
2018-08-04 15:13:01 +00:00
|
|
|
constructor(public id: number) {}
|
2018-08-04 12:23:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* adds a logLine to the log buffer of the test
|
|
|
|
* @param logLine
|
|
|
|
*/
|
|
|
|
addLogLine(logLine: string) {
|
|
|
|
logLine = logLine + '\n';
|
|
|
|
const logLineBuffer = Buffer.from(logLine);
|
|
|
|
this.testLogBuffer = Buffer.concat([this.testLogBuffer, logLineBuffer]);
|
|
|
|
}
|
|
|
|
|
|
|
|
setTestResult(testOkArg: boolean) {
|
|
|
|
this.testOk = testOkArg;
|
|
|
|
this.testSettled = true;
|
|
|
|
}
|
|
|
|
}
|