Mercurial > projects > ldc
comparison tests/makewebstatistics.d @ 261:5723b7385c25 trunk
[svn r279] fixed bug in makewebstatistics, regenerated output
author | ChristianK |
---|---|
date | Fri, 13 Jun 2008 08:21:11 +0200 |
parents | 4234b014a4f2 |
children | 5d2f4814bb2e |
comparison
equal
deleted
inserted
replaced
260:d69d4543c441 | 261:5723b7385c25 |
---|---|
379 Log log = new Log(id, file); | 379 Log log = new Log(id, file); |
380 logs[id] = log; | 380 logs[id] = log; |
381 | 381 |
382 // write status | 382 // write status |
383 BufferedFile makeFile(char[] name) { | 383 BufferedFile makeFile(char[] name) { |
384 return new BufferedFile(std.path.join(dirname, name), FileMode.Out); | 384 return new BufferedFile(std.path.join(dirname, name), FileMode.OutNew); |
385 } | 385 } |
386 BufferedFile[Result] resultsfile = [ | 386 BufferedFile[Result] resultsfile = [ |
387 Result.PASS: makeFile("pass.html"), | 387 Result.PASS: makeFile("pass.html"), |
388 Result.FAIL: makeFile("fail.html"), | 388 Result.FAIL: makeFile("fail.html"), |
389 Result.XPASS: makeFile("xpass.html"), | 389 Result.XPASS: makeFile("xpass.html"), |
401 auto result = test.r & Result.BASE_MASK; | 401 auto result = test.r & Result.BASE_MASK; |
402 resultsfile[result].writefln(test.name, " in ", test.file); | 402 resultsfile[result].writefln(test.name, " in ", test.file); |
403 } | 403 } |
404 | 404 |
405 | 405 |
406 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.Out); | 406 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); |
407 scope(exit) stats.close(); | 407 scope(exit) stats.close(); |
408 stats.writefln(`<tr>`); | 408 stats.writefln(`<tr>`); |
409 stats.writefln(`<td style="padding-right:1em; text-align:left;">`, id, `</td>`); | 409 stats.writefln(`<td style="padding-right:1em; text-align:left;">`, id, `</td>`); |
410 stats.writefln(`<td><a href="`, std.path.join(log.id, "pass.html"), `">`, log.counts[Result.PASS], `</a></td>`); | 410 stats.writefln(`<td><a href="`, std.path.join(log.id, "pass.html"), `">`, log.counts[Result.PASS], `</a></td>`); |
411 stats.writefln(`<td><a href="`, std.path.join(log.id, "xfail.html"), `">`, log.counts[Result.XFAIL], `</a></td>`); | 411 stats.writefln(`<td><a href="`, std.path.join(log.id, "xfail.html"), `">`, log.counts[Result.XFAIL], `</a></td>`); |
448 } | 448 } |
449 newLog = getOrParse(newid, files[1+i]); | 449 newLog = getOrParse(newid, files[1+i]); |
450 oldLog = getOrParse(oldid, files[1+i-1]); | 450 oldLog = getOrParse(oldid, files[1+i-1]); |
451 | 451 |
452 int nRegressions, nImprovements, nChanges; | 452 int nRegressions, nImprovements, nChanges; |
453 auto regressionsFile = new BufferedFile(std.path.join(dirname, "regressions.html"), FileMode.Out); | 453 auto regressionsFile = new BufferedFile(std.path.join(dirname, "regressions.html"), FileMode.OutNew); |
454 scope(exit) regressionsFile.close(); | 454 scope(exit) regressionsFile.close(); |
455 auto improvementsFile = new BufferedFile(std.path.join(dirname, "improvements.html"), FileMode.Out); | 455 auto improvementsFile = new BufferedFile(std.path.join(dirname, "improvements.html"), FileMode.OutNew); |
456 scope(exit) improvementsFile.close(); | 456 scope(exit) improvementsFile.close(); |
457 auto changesFile = new BufferedFile(std.path.join(dirname, "changes.html"), FileMode.Out); | 457 auto changesFile = new BufferedFile(std.path.join(dirname, "changes.html"), FileMode.OutNew); |
458 scope(exit) changesFile.close(); | 458 scope(exit) changesFile.close(); |
459 BufferedFile targetFile; | 459 BufferedFile targetFile; |
460 | 460 |
461 foreach(Test t; newLog.tests.values){ | 461 foreach(Test t; newLog.tests.values){ |
462 Test* oldT = t.file in oldLog.tests; | 462 Test* oldT = t.file in oldLog.tests; |
478 } | 478 } |
479 targetFile.writefln(toString(oldT.r), " -> ", toString(t.r), " : ", t.name, " in ", t.file); | 479 targetFile.writefln(toString(oldT.r), " -> ", toString(t.r), " : ", t.name, " in ", t.file); |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.Out); | 483 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); |
484 scope(exit) stats.close(); | 484 scope(exit) stats.close(); |
485 auto dir = oldid ~ "-to-" ~ newid; | 485 auto dir = oldid ~ "-to-" ~ newid; |
486 stats.writefln(`<tr><td></td>`); | 486 stats.writefln(`<tr><td></td>`); |
487 stats.writefln(`<td style="background-color:white;" colspan="5">`); | 487 stats.writefln(`<td style="background-color:white;" colspan="5">`); |
488 stats.writefln(`<a href="`, std.path.join(dir, "improvements.html"), `">Improvements: `, nImprovements, `</a>, `); | 488 stats.writefln(`<a href="`, std.path.join(dir, "improvements.html"), `">Improvements: `, nImprovements, `</a>, `); |
490 stats.writefln(`<a href="`, std.path.join(dir, "changes.html"), `">Changes: `, nChanges, `</a></td>`); | 490 stats.writefln(`<a href="`, std.path.join(dir, "changes.html"), `">Changes: `, nChanges, `</a></td>`); |
491 stats.writefln(`</tr>`); | 491 stats.writefln(`</tr>`); |
492 } | 492 } |
493 | 493 |
494 // collect all the stats.base files into a large table | 494 // collect all the stats.base files into a large table |
495 BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.Out); | 495 BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.OutNew); |
496 scope(exit) index.close(); | 496 scope(exit) index.close(); |
497 index.writefln(` | 497 index.writefln(` |
498 <html><body> | 498 <html><body> |
499 <table style="border-collapse:collapse; text-align:center;"> | 499 <table style="border-collapse:collapse; text-align:center;"> |
500 <colgroup> | 500 <colgroup> |