Skip to content

Commit

Permalink
Various minor visual enhancements for Sapphire test report
Browse files Browse the repository at this point in the history
  • Loading branch information
phalkunz committed Aug 31, 2012
1 parent 1629a85 commit 60987ac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
15 changes: 12 additions & 3 deletions css/debug.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ body { background-color: #eee; margin: 0; overflow-x: hidden; padding: 0; font-f
.header { margin: 0; border-bottom: 6px solid #ccdef3; height: 23px; background-color: #666673; padding: 4px 0 2px 6px; } .header { margin: 0; border-bottom: 6px solid #ccdef3; height: 23px; background-color: #666673; padding: 4px 0 2px 6px; }


.trace, .build, .options { padding: 6px 12px; } .trace, .build, .options { padding: 6px 12px; }
.trace .test-case { font-size: 1.1em; }
.trace li, .build li, .options li { font-size: 14px; margin: 6px 0; } .trace li, .build li, .options li { font-size: 14px; margin: 6px 0; }
.trace .failure { margin: 1em 0 2em; }
.trace .failure pre { color: #C80700; background: #FFE9E9; border-color: #C80700; }


a { color: #666; } a { color: #666; }
a:hover { color: #222; } a:hover { color: #222; }
a:active { color: #111; } a:active { color: #111; }


p { margin-bottom: 6px; } p { margin-bottom: 6px; }


pre { margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.08); color: #333; padding: 11px; overflow: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } pre { margin: 1em 0; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.1); color: #333; padding: 10px 15px; overflow: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
pre span { color: #999; } pre span { color: #999; }
pre .error { color: #f00; } pre .error { color: #f00; }


Expand All @@ -28,6 +31,12 @@ h3 { margin: 0 0 6px 0; color: #333; font-size: 18px; line-height: 24px; }


ul { margin: 0 0 18px 0; padding: 0 0 0 18px; } ul { margin: 0 0 18px 0; padding: 0 0 0 18px; }


.pass { margin-top: 18px; padding: 2px 20px 2px 40px; color: #006600; background: #E2F9E3; border: 1px solid #8DD38D; border-radius: 4px; } .status { margin-top: 18px; padding: 0; color: #333; background: #EEEEEE; border: 1px solid #CCCCCC; border-radius: 4px; }
.status h2 { margin: 10px 15px; }
.pass { color: #006600; background: #E2F9E3; border-color: #8DD38D; }
.fail { color: #C80700; background: #FFE9E9; border-color: #C80700; }


.fail { margin-top: 18px; padding: 2px 20px 2px 40px; color: #C80700; background: #FFE9E9; border: 1px solid #C80700; border-radius: 4px; } .message { background-color: white; color: #333; margin: 0.5em; padding: 0.5em 0.8em 0.4em; border: 1px #CCC solid; border-radius: 4px; }
.message.warning { color: #fc7330; background: #fcf5ed; border-color: #fdd0a0; }

.total-time { padding: 0 15px; margin-bottom: 1em; }
2 changes: 1 addition & 1 deletion dev/Debug.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static function message($message, $showHeader = true) {
if($showHeader) echo "Debug (line $caller[line] of $file):\n "; if($showHeader) echo "Debug (line $caller[line] of $file):\n ";
echo $message . "\n"; echo $message . "\n";
} else { } else {
echo "<p style=\"background-color: white; color: black; width: 95%; margin: 0.5em; padding: 0.3em; border: 1px #CCC solid\">\n"; echo "<p class=\"message warning\">\n";
if($showHeader) echo "<b>Debug (line $caller[line] of $file):</b>\n "; if($showHeader) echo "<b>Debug (line $caller[line] of $file):</b>\n ";
echo Convert::raw2xml($message) . "</p>\n"; echo Convert::raw2xml($message) . "</p>\n";
} }
Expand Down
2 changes: 1 addition & 1 deletion dev/DebugView.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function Breadcrumbs() {
$pathLinks[] = "<a href=\"$base$pathPart\">$part</a>"; $pathLinks[] = "<a href=\"$base$pathPart\">$part</a>";
} }
} }
return implode('&rarr;&nbsp;', $pathLinks); return implode('&nbsp;&rarr;&nbsp;', $pathLinks);
} }


/** /**
Expand Down
4 changes: 2 additions & 2 deletions dev/SapphireTestReporter.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ public function writeResults() {
} }


if ($test['status'] != 1) { if ($test['status'] != 1) {
echo "<div class=\"failure\"><span>&otimes; ". $this->testNameToPhrase($test['name']) ."</span><br>"; echo "<div class=\"failure\"><h2 class=\"test-case\">&otimes; ". $this->testNameToPhrase($test['name']) ."</h2>";
echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre><br>"; echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre>";
echo SS_Backtrace::get_rendered_backtrace($test['trace']); echo SS_Backtrace::get_rendered_backtrace($test['trace']);
echo "</div>"; echo "</div>";
} }
Expand Down
2 changes: 1 addition & 1 deletion dev/TestRunner.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class_exists($className);


$endTime = microtime(true); $endTime = microtime(true);
if(Director::is_cli()) echo "\n\nTotal time: " . round($endTime-$startTime,3) . " seconds\n"; if(Director::is_cli()) echo "\n\nTotal time: " . round($endTime-$startTime,3) . " seconds\n";
else echo "<p>Total time: " . round($endTime-$startTime,3) . " seconds</p>\n"; else echo "<p class=\"total-time\">Total time: " . round($endTime-$startTime,3) . " seconds</p>\n";


if(!Director::is_cli()) echo '</div>'; if(!Director::is_cli()) echo '</div>';


Expand Down

0 comments on commit 60987ac

Please sign in to comment.