feat(implement testing): update

This commit is contained in:
2018-08-04 14:23:07 +02:00
parent a5ace2fa49
commit 662c472055
9 changed files with 164 additions and 22 deletions

View File

@@ -1,7 +1,9 @@
import * as plugins from './tstest.plugins';
import { TestDirectory } from './tstest.classes.testdirectory';
import { TapCombinator } from './tstest.tap.combinator';
import { TapParser } from './tstest.tap.parser';
import * as plugins from "./tstest.plugins";
import { coloredString as cs } from '@pushrocks/consolecolor';
import { TestDirectory } from "./tstest.classes.testdirectory";
import { TapCombinator } from "./tstest.tap.combinator";
import { TapParser } from "./tstest.tap.parser";
export class TsTest {
testDir: TestDirectory;
@@ -12,19 +14,26 @@ export class TsTest {
async run() {
const fileNamesToRun: string[] = await this.testDir.getTestFilePathArray();
console.log(`Found ${fileNamesToRun.length} test(s):`);
console.log(`Found ${fileNamesToRun.length} Testfile(s):`);
for (const fileName of fileNamesToRun) {
console.log(fileName);
console.log(cs(fileName, "orange"));
}
console.log("-".repeat(16));
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
executor: "bash",
sourceFilePaths: []
});
const tapCombinator = new TapCombinator(); // lets create the TapCombinator
for (const fileName of fileNamesToRun) {
console.log(`${cs("=> ", "blue")} Running ${cs(fileName, "orange")}`);
console.log(`=`.repeat(16));
const tapParser = new TapParser();
const execResultStreaming = await smartshellInstance.execStreamingSilent(`tsrun ${fileName}`);
const execResultStreaming = await smartshellInstance.execStreamingSilent(
`tsrun ${fileName}`
);
await tapParser.handleTapProcess(execResultStreaming.childProcess);
tapCombinator.addTapParser(tapParser);
}
tapCombinator.evaluate();
}
}