mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Made timing code for test runner more accurate (includes initial db build):
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84970 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4ee62ae7eb
commit
5829c86947
@ -34,9 +34,6 @@ class CliTestReporter extends SapphireTestReporter {
|
||||
if(function_exists('memory_get_peak_usage')) {
|
||||
echo "Maximum memory usage: " . number_format(memory_get_peak_usage()/(1024*1024), 1) . "M\n\n";
|
||||
}
|
||||
|
||||
$totalTime = array_sum($this->testSpeeds);
|
||||
echo "Total time: " . round($totalTime,3) . " seconds\n";
|
||||
|
||||
// Use sake dev/tests/all --showslow to show slow tests
|
||||
if((isset($_GET['args']) && is_array($_GET['args']) && in_array('--showslow', $_GET['args'])) || isset($_GET['showslow'])) {
|
||||
|
@ -172,6 +172,8 @@ class TestRunner extends Controller {
|
||||
* @param boolean $coverage
|
||||
*/
|
||||
function runTests($classList, $coverage = false) {
|
||||
$startTime = microtime(true);
|
||||
|
||||
// XDEBUG seem to cause problems with test execution :-(
|
||||
if(function_exists('xdebug_disable')) xdebug_disable();
|
||||
|
||||
@ -230,6 +232,10 @@ class TestRunner extends Controller {
|
||||
|
||||
if(!Director::is_cli()) echo '<div class="trace">';
|
||||
$reporter->writeResults();
|
||||
|
||||
$endTime = microtime(true);
|
||||
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";
|
||||
|
||||
if(!Director::is_cli()) echo '</div>';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user