Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.51 diff -u -r1.51 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 15 Oct 2008 16:05:51 -0000 1.51 +++ modules/simpletest/drupal_web_test_case.php 20 Oct 2008 03:13:22 -0000 @@ -1,6 +1,21 @@ drupalGetContent() */ function drupalGet($path, $options = array()) { + benchmark_start(BENCHMARK_PAGE_REQUEST); $options['absolute'] = TRUE; // We re-using a CURL connection here. If that connection still has certain @@ -888,6 +908,7 @@ if (($new = $this->checkForMetaRefresh())) { $out = $new; } + benchmark_stop(); return $out; } @@ -924,6 +945,7 @@ * Options to be forwarded to url(). */ function drupalPost($path, $edit, $submit, $options = array()) { + benchmark_start(BENCHMARK_PAGE_REQUEST); $submit_matches = FALSE; if (isset($path)) { $html = $this->drupalGet($path, $options); @@ -968,6 +990,7 @@ if (($new = $this->checkForMetaRefresh())) { $out = $new; } + benchmark_stop(); return $out; } } @@ -978,6 +1001,7 @@ $this->assertTrue($submit_matches, t('Found the @submit button', array('@submit' => $submit))); $this->fail(t('Found the requested form fields at @path', array('@path' => $path))); } + benchmark_stop(); } /** Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.21 diff -u -r1.21 simpletest.module --- modules/simpletest/simpletest.module 15 Oct 2008 14:17:27 -0000 1.21 +++ modules/simpletest/simpletest.module 20 Oct 2008 03:13:22 -0000 @@ -305,6 +305,9 @@ } } if (count($tests_list) > 0 ) { + db_query('DELETE FROM benchmark'); + + $_SESSION['b_start'] = microtime(TRUE); simpletest_run_tests($tests_list, 'drupal'); } else { @@ -407,6 +410,14 @@ else { drupal_set_message(t('The tests did not successfully finish.'), 'error'); } + + require_once drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php'; + drupal_set_message('Total elapse: ' . (microtime(TRUE) - $_SESSION['b_start'])); + + $install = db_result(db_query('SELECT SUM(elapse) FROM benchmark WHERE type = %d', BENCHMARK_INSTALL)); + $request = db_result(db_query('SELECT SUM(elapse) FROM benchmark WHERE type = %d', BENCHMARK_PAGE_REQUEST)); + + drupal_set_message('install: ' . $install . ', request: ' . $request); } /**