Mercurial > projects > ldc
comparison tests/makewebstatistics.d @ 497:70faa6af1357
Change web statistics layout, thanks anders!
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 12 Aug 2008 18:33:34 +0200 |
parents | faa03bf92f0d |
children | 648409a7fb0c |
comparison
equal
deleted
inserted
replaced
496:8bd31c8208da | 497:70faa6af1357 |
---|---|
375 | 375 |
376 // collect all the stats.base files into a large table | 376 // collect all the stats.base files into a large table |
377 BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.OutNew); | 377 BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.OutNew); |
378 scope(exit) index.close(); | 378 scope(exit) index.close(); |
379 index.writefln(` | 379 index.writefln(` |
380 <html><body> | 380 <!DOCTYPE html> |
381 <h1>DStress results for x86-32 Linux.</h1> | 381 <html> |
382 <p> | 382 <head> |
383 In short, results are defined as follows | 383 <title>DStress results for x86-32 Linux</title> |
384 <ul> | 384 <style type="text/css"> |
385 <li>PASS: test passed and was expected to pass</li> | 385 body { |
386 <li>XFAIL: test failed and was exprected to fail</li> | 386 font-family: Arial, Helvetica, sans-serif; |
387 <li>FAIL: test failed but was expected to pass</li> | 387 font-size: 0.8em; |
388 <li>XPASS: test passed but was expected to fail</li> | 388 } |
389 <li>ERROR: compiler, linker or test segfaulted</li> | 389 a { |
390 </ul> | 390 text-decoration: none; |
391 while the differences between tests are grouped into | 391 } |
392 <ul> | 392 a:hover { |
393 <li>Improvements: changed from FAIL, XPASS or ERROR to PASS or XFAIL</li> | 393 border-bottom: 1px dotted blue; |
394 <li>Regressions: changed from PASS or XFAIL to FAIL, XPASS or ERROR</li> | 394 } |
395 <li>Changes: changed within the good or bad group without crossing over</li> | 395 table { |
396 </ul> | 396 border-collapse: collapse; |
397 </p> | 397 } |
398 <br><br> | 398 tr { |
399 <table style="border-collapse:collapse; text-align:center;"> | 399 border-bottom: 1px solid #CCC; |
400 <colgroup> | 400 } |
401 <col style="border-right: medium solid black;"> | 401 tr.odd { |
402 <col style="background-color: #AAFFAA;"> | 402 background: #e0e0e0; |
403 <col style="background-color: #AAFFAA; border-right: thin solid black;"> | 403 } |
404 <col style="background-color: #FFAAAA;"> | 404 tr.head { |
405 <col style="background-color: #FFAAAA;"> | 405 border-bottom: none; |
406 <col style="background-color: #FFAAAA;"> | 406 } |
407 <col style="border-left: medium solid black;"> | 407 td,th { |
408 </colgroup> | 408 padding: 2px 10px 2px 10px; |
409 <tr style="border-bottom: medium solid black;"> | 409 } |
410 <th>name</th> | 410 .result:hover { |
411 <th style="padding-left:1em;padding-right:1em;">PASS</th> | 411 background: #C3DFFF; |
412 <th style="padding-left:1em;padding-right:1em;">XFAIL</th> | 412 } |
413 <th style="padding-left:1em;padding-right:1em;">FAIL</th> | 413 .pass,.xfail,.xpass,.fail,.xpass,.error,.generic { |
414 <th style="padding-left:1em;padding-right:1em;">XPASS</th> | 414 text-align: center; |
415 <th style="padding-left:1em;padding-right:1em;">ERROR</th> | 415 } |
416 <th style="padding-left:1em;padding-right:1em;">comparison to ` ~ std.path.getBaseName(reference) ~ `</th> | 416 .generic { |
417 </tr> | 417 background: #EEE; |
418 color: gray; | |
419 } | |
420 .pass { | |
421 background: #98FF90; | |
422 color: green; | |
423 } | |
424 tr:hover .pass { | |
425 background: #83E67B; | |
426 } | |
427 .xfail { | |
428 background: #BDFFB8; | |
429 color: #0CAE00; | |
430 } | |
431 tr:hover .xfail { | |
432 background: #98FF90; | |
433 } | |
434 .fail { | |
435 background: #FF6E7A; | |
436 color: maroon; | |
437 } | |
438 .xpass { | |
439 background: #FF949D; | |
440 color: maroon; | |
441 } | |
442 .error { | |
443 background: #FFB3B9; | |
444 color: maroon; | |
445 } | |
446 .borderleft { | |
447 border-left: 1px solid #CCC; | |
448 } | |
449 </style> | |
450 </head> | |
451 | |
452 <body> | |
453 <h1>DStress results for x86-32 Linux</h1> | |
454 | |
455 <h2>Legend</h2> | |
456 <table id="legend"> | |
457 <tr> | |
458 <th>Color</th> | |
459 <th>Description</th> | |
460 </tr> | |
461 <tr class="result"> | |
462 <td class="pass">PASS</td> | |
463 <td>Test passed and was expected to pass</td> | |
464 </tr> | |
465 <tr class="result"> | |
466 <td class="xfail">XFAIL</td> | |
467 <td>Test failed and expected to fail</td> | |
468 </tr> | |
469 <tr class="result"> | |
470 <td class="fail">FAIL</td> | |
471 <td>Test failed but was expected to pass</td> | |
472 </tr> | |
473 <tr class="result"> | |
474 <td class="xpass">XPASS</td> | |
475 <td>Test passed but was expected to fail</td> | |
476 </tr> | |
477 <tr class="result"> | |
478 <td class="error">ERROR</td> | |
479 <td>The compiler, linker or the test segfaulted</td> | |
480 </tr> | |
481 <tr class="result"> | |
482 <td class="generic">+</td> | |
483 <td>Changes from FAIL, XPASS or ERROR to PASS or XFAIL</td> | |
484 </tr> | |
485 <tr class="result"> | |
486 <td class="generic">-</td> | |
487 <td>Changes from PASS or XFAIL to FAIL, XPASS or ERROR</td> | |
488 </tr> | |
489 <tr class="result"> | |
490 <td class="generic">chg</td> | |
491 <td>Changed within the good or bad group without crossing over</td> | |
492 </tr> | |
493 </table> | |
494 | |
495 <h2>Results</h2> | |
496 <table> | |
497 <tr class="head"> | |
498 <th></th> | |
499 <th colspan="5" class="borderleft">Test results</th> | |
500 <th colspan="3" class="borderleft">Diff to previous</th> | |
501 <th colspan="3" class="borderleft">Diff to ` ~ std.path.getBaseName(reference) ~ `</th> | |
502 </tr> | |
503 <tr> | |
504 <th>Name</th> | |
505 <th class="borderleft">PASS</th> | |
506 <th>XFAIL</th> | |
507 <th>FAIL</th> | |
508 <th>XPASS</th> | |
509 <th>ERROR</th> | |
510 <th class="borderleft">+</th> | |
511 <th>-</th> | |
512 <th>chg</th> | |
513 <th class="borderleft">+</th> | |
514 <th>-</th> | |
515 <th>chg</th> | |
516 </tr> | |
418 `); | 517 `); |
419 | 518 |
420 for(int i = files.length - 1; i >= 0; --i) { | 519 for(int i = files.length - 1; i >= 0; --i) { |
421 auto file = files[i]; | 520 auto file = files[i]; |
422 index.writefln(`<tr>`); | 521 index.writefln(`<tr class="` ~ (i%2 ? `result` : `odd result`) ~ `">`); |
423 char[] id = std.path.getBaseName(file); | 522 char[] id = std.path.getBaseName(file); |
424 char[] statsname = std.path.join(std.path.join(basedir, id), "stats.base"); | 523 char[] statsname = std.path.join(std.path.join(basedir, id), "stats.base"); |
425 index.writef(cast(char[])std.file.read(statsname)); | 524 index.writef(cast(char[])std.file.read(statsname)); |
426 | 525 |
526 if(i != 0) { | |
527 char[] newid = std.path.getBaseName(files[i-1]); | |
528 statsname = std.path.join(std.path.join(basedir, newid ~ "-to-" ~ id), "stats.base"); | |
529 index.writef(cast(char[])std.file.read(statsname)); | |
530 } else { | |
531 index.writefln(`<td class="borderleft"></td><td></td><td></td>`); | |
532 } | |
533 | |
427 if(i != files.length - 1) { | 534 if(i != files.length - 1) { |
428 index.writefln(`<td>`); | |
429 char[] refid = std.path.getBaseName(reference); | 535 char[] refid = std.path.getBaseName(reference); |
430 statsname = std.path.join(std.path.join(basedir, refid ~ "-to-" ~ id), "stats.base"); | 536 statsname = std.path.join(std.path.join(basedir, refid ~ "-to-" ~ id), "stats.base"); |
431 index.writef(cast(char[])std.file.read(statsname)); | 537 index.writef(cast(char[])std.file.read(statsname)); |
432 index.writefln(`</td></tr>`); | |
433 } else { | 538 } else { |
434 index.writefln(`<td></td></tr>`); | 539 index.writefln(`<td class="borderleft"></td><td></td><td></td>`); |
435 } | 540 } |
436 | 541 |
437 if(i == 0) { | 542 index.writefln(`</tr>`); |
438 continue; | |
439 } | |
440 | |
441 index.writefln(`<tr><td></td>`); | |
442 index.writefln(`<td style="background-color:white;" colspan="5">`); | |
443 char[] newid = std.path.getBaseName(files[i-1]); | |
444 statsname = std.path.join(std.path.join(basedir, newid ~ "-to-" ~ id), "stats.base"); | |
445 index.writef(cast(char[])std.file.read(statsname)); | |
446 index.writefln(`</td><td></td></tr>`); | |
447 } | 543 } |
448 | 544 |
449 index.writefln(`</table></body></html>`); | 545 index.writefln(`</table></body></html>`); |
450 | 546 |
451 return 0; | 547 return 0; |
503 file.writefln(`</body></html>`); | 599 file.writefln(`</body></html>`); |
504 } | 600 } |
505 | 601 |
506 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); | 602 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); |
507 scope(exit) stats.close(); | 603 scope(exit) stats.close(); |
508 stats.writefln(`<td style="padding-right:1em; text-align:left;">`, id, `</td>`); | 604 stats.writefln(`<td>`, id, `</td>`); |
509 stats.writefln(`<td><a href="`, std.path.join(log.id, "pass.html"), `">`, log.counts[Result.PASS], `</a></td>`); | 605 stats.writefln(`<td class="pass borderleft"><a href="`, std.path.join(log.id, "pass.html"), `">`, log.counts[Result.PASS], `</a></td>`); |
510 stats.writefln(`<td><a href="`, std.path.join(log.id, "xfail.html"), `">`, log.counts[Result.XFAIL], `</a></td>`); | 606 stats.writefln(`<td class="xfail"><a href="`, std.path.join(log.id, "xfail.html"), `">`, log.counts[Result.XFAIL], `</a></td>`); |
511 stats.writefln(`<td><a href="`, std.path.join(log.id, "fail.html"), `">`, log.counts[Result.FAIL], `</a></td>`); | 607 stats.writefln(`<td class="fail"><a href="`, std.path.join(log.id, "fail.html"), `">`, log.counts[Result.FAIL], `</a></td>`); |
512 stats.writefln(`<td><a href="`, std.path.join(log.id, "xpass.html"), `">`, log.counts[Result.XPASS], `</a></td>`); | 608 stats.writefln(`<td class="xpass"><a href="`, std.path.join(log.id, "xpass.html"), `">`, log.counts[Result.XPASS], `</a></td>`); |
513 stats.writefln(`<td><a href="`, std.path.join(log.id, "error.html"), `">`, log.counts[Result.ERROR], `</a></td>`); | 609 stats.writefln(`<td class="error"><a href="`, std.path.join(log.id, "error.html"), `">`, log.counts[Result.ERROR], `</a></td>`); |
514 } | 610 } |
515 | 611 |
516 void generateChangeStatistics(char[] file1, char[] file2, ref Log[char[]] logs) | 612 void generateChangeStatistics(char[] file1, char[] file2, ref Log[char[]] logs) |
517 { | 613 { |
518 char[] newid = std.path.getBaseName(file1); | 614 char[] newid = std.path.getBaseName(file1); |
593 } | 689 } |
594 | 690 |
595 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); | 691 BufferedFile stats = new BufferedFile(std.path.join(dirname, "stats.base"), FileMode.OutNew); |
596 scope(exit) stats.close(); | 692 scope(exit) stats.close(); |
597 auto dir = oldid ~ "-to-" ~ newid; | 693 auto dir = oldid ~ "-to-" ~ newid; |
598 stats.writefln(`<a href="`, std.path.join(dir, "improvements.html"), `">Improvements: `, nImprovements, `</a>, `); | 694 stats.writefln(`<td class="borderleft"><a href="`, std.path.join(dir, "improvements.html"), `">`, nImprovements, `</a></td>`); |
599 stats.writefln(`<a href="`, std.path.join(dir, "regressions.html"), `">Regressions: `, nRegressions, `</a>, `); | 695 stats.writefln(`<td><a href="`, std.path.join(dir, "regressions.html"), `">`, nRegressions, `</a></td>`); |
600 stats.writefln(`<a href="`, std.path.join(dir, "changes.html"), `">Changes: `, nChanges, `</a>`); | 696 stats.writefln(`<td><a href="`, std.path.join(dir, "changes.html"), `">`, nChanges, `</a></td>`); |
601 } | 697 } |