(relPath, strict, label)
| 158 | } |
| 159 | |
| 160 | loadTestcase(relPath, strict, label) { |
| 161 | const start = Date.now(); |
| 162 | try { |
| 163 | const source = sourceHelpers.loadSource( |
| 164 | this, relPath, strict, random.choose(module.exports.TRANSPILE_PROB)); |
| 165 | if (program.verbose) { |
| 166 | const duration = Date.now() - start; |
| 167 | console.log(`Parsing ${relPath} ${label} took ${duration} ms.`); |
| 168 | } |
| 169 | if (exceptions.hasFlagsDiscouragingFiles(source.flags) && |
| 170 | random.choose(module.exports.DROP_DISCOURAGED_FILES_PROB)) { |
| 171 | return undefined |
| 172 | } |
| 173 | return source; |
| 174 | } catch (e) { |
| 175 | console.log(`WARNING: failed to ${label} parse ${relPath}`); |
| 176 | console.log(e); |
| 177 | } |
| 178 | return undefined; |
| 179 | } |
| 180 | |
| 181 | *loadTestcases(relPaths) { |
| 182 | for (const relPath of relPaths) { |
no test coverage detected