()
| 339 | |
| 340 | // Main execution |
| 341 | async function main(): Promise<void> { |
| 342 | const args = process.argv.slice(2); |
| 343 | const dryRun = args.includes("--dry-run"); |
| 344 | const apply = args.includes("--apply"); |
| 345 | const fileArg = args.find((a) => a.startsWith("--file=")); |
| 346 | const specificFile = fileArg ? fileArg.slice(7) : null; |
| 347 | |
| 348 | console.log("TCK Audit Script"); |
| 349 | console.log("================"); |
| 350 | console.log(""); |
| 351 | |
| 352 | // Find test files |
| 353 | let testFiles: string[]; |
| 354 | if (specificFile) { |
| 355 | testFiles = [path.resolve(specificFile)]; |
| 356 | } else { |
| 357 | testFiles = findTestFiles(TCK_DIR); |
| 358 | } |
| 359 | console.log(`Found ${testFiles.length} test files`); |
| 360 | |
| 361 | // Extract all skipped tests |
| 362 | const allSkipped: SkippedTest[] = []; |
| 363 | for (const file of testFiles) { |
| 364 | allSkipped.push(...extractSkippedTests(file)); |
| 365 | } |
| 366 | console.log(`Found ${allSkipped.length} skipped tests`); |
| 367 | console.log(` - Design exclusions: ${allSkipped.filter((t) => t.category === "design").length}`); |
| 368 | console.log( |
| 369 | ` - Now working candidates: ${allSkipped.filter((t) => t.category === "now_working").length}`, |
| 370 | ); |
| 371 | console.log(` - Unknown: ${allSkipped.filter((t) => t.category === "unknown").length}`); |
| 372 | console.log(""); |
| 373 | |
| 374 | let results: TestResult[] = []; |
| 375 | |
| 376 | if (!dryRun) { |
| 377 | // Filter to "now working" candidates for testing |
| 378 | const candidates = allSkipped.filter((t) => t.category === "now_working"); |
| 379 | console.log(`Testing ${candidates.length} "now working" candidates...`); |
| 380 | console.log(""); |
| 381 | |
| 382 | for (let i = 0; i < candidates.length; i++) { |
| 383 | const test = candidates[i]; |
| 384 | const relPath = path.relative(TCK_DIR, test.file); |
| 385 | process.stdout.write( |
| 386 | `[${i + 1}/${candidates.length}] ${relPath}: ${test.testName.slice(0, 40)}...`, |
| 387 | ); |
| 388 | |
| 389 | const result = tryRunTest(test); |
| 390 | results.push(result); |
| 391 | |
| 392 | console.log(result.passed ? " PASS" : " FAIL"); |
| 393 | } |
| 394 | console.log(""); |
| 395 | } |
| 396 | |
| 397 | // Generate report |
| 398 | const report = generateReport(allSkipped, results); |
no test coverage detected