()
| 35 | } |
| 36 | |
| 37 | export function runNativeAssetSmokeIfRequested(): boolean { |
| 38 | if (process.env['KIMI_CODE_NATIVE_ASSET_SMOKE'] !== '1') return false; |
| 39 | |
| 40 | try { |
| 41 | const manifest = getEmbeddedNativeAssetManifest(); |
| 42 | if (manifest === null) { |
| 43 | throw new Error('Native asset manifest is not available.'); |
| 44 | } |
| 45 | for (const packageName of smokePackages) { |
| 46 | const packageRoot = getNativePackageRoot(packageName, { manifest }); |
| 47 | if (packageRoot === null) { |
| 48 | throw new Error(`Native package is not available: ${packageName}`); |
| 49 | } |
| 50 | } |
| 51 | smokePiTuiNativeLoad(); |
| 52 | process.stdout.write(`Native asset smoke passed: ${manifest.target}\n`); |
| 53 | process.exit(0); |
| 54 | } catch (error) { |
| 55 | const message = error instanceof Error ? error.message : String(error); |
| 56 | process.stderr.write(`Native asset smoke failed: ${message}\n`); |
| 57 | process.exit(1); |
| 58 | } |
| 59 | } |
no test coverage detected