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
@ -35,9 +35,6 @@ class CliTestReporter extends SapphireTestReporter {
|
|||||||
echo "Maximum memory usage: " . number_format(memory_get_peak_usage()/(1024*1024), 1) . "M\n\n";
|
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
|
// 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'])) {
|
if((isset($_GET['args']) && is_array($_GET['args']) && in_array('--showslow', $_GET['args'])) || isset($_GET['showslow'])) {
|
||||||
$avgSpeed = round(array_sum($this->testSpeeds) / count($this->testSpeeds), 3);
|
$avgSpeed = round(array_sum($this->testSpeeds) / count($this->testSpeeds), 3);
|
||||||
|
@ -172,6 +172,8 @@ class TestRunner extends Controller {
|
|||||||
* @param boolean $coverage
|
* @param boolean $coverage
|
||||||
*/
|
*/
|
||||||
function runTests($classList, $coverage = false) {
|
function runTests($classList, $coverage = false) {
|
||||||
|
$startTime = microtime(true);
|
||||||
|
|
||||||
// XDEBUG seem to cause problems with test execution :-(
|
// XDEBUG seem to cause problems with test execution :-(
|
||||||
if(function_exists('xdebug_disable')) xdebug_disable();
|
if(function_exists('xdebug_disable')) xdebug_disable();
|
||||||
|
|
||||||
@ -231,6 +233,10 @@ class TestRunner extends Controller {
|
|||||||
if(!Director::is_cli()) echo '<div class="trace">';
|
if(!Director::is_cli()) echo '<div class="trace">';
|
||||||
$reporter->writeResults();
|
$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>';
|
if(!Director::is_cli()) echo '</div>';
|
||||||
|
|
||||||
// Put the error handlers back
|
// Put the error handlers back
|
||||||
|
Loading…
x
Reference in New Issue
Block a user