From 2b90609df4bfac3306a9bb77361d7380e8f33e90 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 27 Nov 2025 10:40:15 -0800 Subject: [PATCH] Feat: Read test results from file instead of running --- index.html | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index bdfb815..2f76c63 100644 --- a/index.html +++ b/index.html @@ -114,7 +114,6 @@ list.appendChild(li); const outUrl=`./tests/${test}/outputs/${sModel}.js`; - // Check if file exists by trying to fetch head or text const srcP=fetch(outUrl).then(r=>{ if(!r.ok) throw new Error('404'); return r.text(); @@ -128,19 +127,11 @@ continue; } ran++; - let status='✅'; - try{ - const testP=(async()=>{ - const tMod=await import(`./tests/${test}/test.js`); - const lMod=await import(outUrl); - await tMod.default.runTest(lMod.default); - })(); - await Promise.race([testP,new Promise((_,r)=>setTimeout(()=>r(new Error('Timeout')),12000))]); - }catch(e){ - console.error(`${model} - ${test}: `,e); - status='❌'; - } + + const resMatch=src.match(/\/\/ Result: (PASS|FAIL)/); + const status=resMatch?(resMatch[1]==='PASS'?'✅':'❌'):'❓'; if(status==='✅')passed++; + const fTime=src.match(/\/\/ Generation time: ([\d\.]+)s/)?.[1]; const timeStr=fTime?`${parseFloat(fTime).toFixed(3)}s`:'N/A'; li.innerHTML=`${status} ${test}${timeStr}`;