Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.39
diff -u -p -r1.39 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	14 Sep 2008 06:46:34 -0000	1.39
+++ modules/simpletest/drupal_web_test_case.php	16 Sep 2008 04:38:58 -0000
@@ -294,6 +294,7 @@ class DrupalWebTestCase {
    * Run all tests in this class.
    */
   function run() {
+    set_time_limit(0);
     set_error_handler(array($this, 'errorHandler'));
     $methods = array();
     // Iterate through all the methods in this class.
Index: modules/simpletest/simpletest.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.install,v
retrieving revision 1.8
diff -u -p -r1.8 simpletest.install
--- modules/simpletest/simpletest.install	10 Sep 2008 04:13:01 -0000	1.8
+++ modules/simpletest/simpletest.install	16 Sep 2008 04:38:27 -0000
@@ -107,6 +107,14 @@ function simpletest_requirements($phase)
   $t = get_t();
 
   $has_curl = function_exists('curl_init');
+  
+  $max_execution_time = ini_get('max_execution_time');
+  if ($max_execution_time == 0 || $max_execution_time >= 240) {
+    $sufficient_execution_time = TRUE;
+  }
+  else {
+    $sufficient_execution_time = !ini_get('safe_mode') && function_exists('set_time_limit');
+  }
 
   switch ($phase) {
     case 'runtime':
@@ -115,6 +123,12 @@ function simpletest_requirements($phase)
         'value' => $has_curl ? $t('Enabled') : $t('Not found'),
         'severity' => $has_curl ? REQUIREMENT_OK : REQUIREMENT_ERROR,
       );
+      $requirements['simpletest_execution_time'] = array(
+        'title' => $t('PHP maximum execution time'),
+        'value' => $max_execution_time ? $t('Infinite') : format_interval($max_execution_time),
+        'severity' => $sufficient_execution_time ? REQUIREMENT_OK : REQUIREMENT_ERROR,
+        'description' => !$sufficient_execution_time ? $t('Please set your <em>max_execution_time</em> to a minimum of 240s.') : '',
+      );
       break;
     case 'install':
       if ($has_curl) {
@@ -130,6 +144,13 @@ function simpletest_requirements($phase)
           'description' => $t('Simpletest could not be installed because the PHP <a href="!curl_url">cURL</a> library is not available.', array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
         );
       }
+      if (!$sufficient_execution_time) {
+        $requirements['simpletest_execution_time'] = array(
+          'title' => $t('PHP maximum execution time'),
+          'severity' => REQUIREMENT_ERROR,
+          'description' => $t('Simpletest could not be installed because the PHP <em>max_execution_time</em> setting is too low and cannot be changed at runtime.') . ' ' . $t('Please set your <em>max_execution_time</em> to a minimum of 240s.'),
+        );
+      }
       break;
   }
 
