| 122 | } |
| 123 | |
| 124 | function collectTests(xuint, testFilter) { |
| 125 | const suites = xuint.testsuites.testsuite; |
| 126 | |
| 127 | const tests = []; |
| 128 | |
| 129 | for (const suite of suites) { |
| 130 | if (suite.testcase) { |
| 131 | for (const test of suite.testcase) { |
| 132 | const fullName = `${suite.$.name} ${test.$.name}`; |
| 133 | if (fullName.toLowerCase().includes(testFilter.toLowerCase())) { |
| 134 | if (test.$.start === class="st">'0') { |
| 135 | if (warnings) console.error(`Warning: ${fullName} was skipped, theres no logs`); |
| 136 | continue; |
| 137 | } |
| 138 | tests.push({ |
| 139 | name: fullName, |
| 140 | start: Date.parse(test.$.start), |
| 141 | end: Date.parse(test.$.end) |
| 142 | }); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | return tests; |
| 149 | } |
| 150 | |
| 151 | main(process.argv).catch(e => { |
| 152 | console.error(e); |