-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (35 loc) · 979 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var readline = require("readline");
var Error = require("./error.js");
var builder = require("junit-report-builder");
var program = require("commander");
program
.version("0.1.0")
.option("-n, --name [name]", "Set name for testsuide", "ABAPLint")
.option("-f, --file [file]", "Set report filename", "report.xml")
.parse(process.argv);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
var suite = builder.testSuite().name(program.name);
var failure = false;
//array.forEach(line => {
rl.on("line", line => {
let obj = new Error(line);
if (obj.isValid()) {
var testCase = suite
.testCase()
.className(obj.getClassname())
.name(obj.getName())
.failure(line);
failure = true;
console.log(line);
}
});
rl.on("close", () => {
builder.writeTo(program.file);
if (failure) {
process.exit(1);
}
});