Index: modules/simpletest/simpletest.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.install,v
retrieving revision 1.40
diff -u -p -r1.40 simpletest.install
--- modules/simpletest/simpletest.install	12 Nov 2010 03:06:52 -0000	1.40
+++ modules/simpletest/simpletest.install	2 Jan 2011 21:34:43 -0000
@@ -58,6 +58,14 @@ function simpletest_requirements($phase)
     $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
   }
 
+  // Check the current memory limit, if too low, SimpleTest will fail to load all
+  // tests and throw a fatal error.
+  $limit = intval(trim(ini_get('memory_limit'), 'M'));
+  if ($limit < 64) {
+    $requirements['php_memory_limit']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_memory_limit']['description'] = t('To run tests, your PHP memory limit needs to be at least 64M. Your current value is %limitM. <a href="!url">Follow these steps to continue</a>.', array('%limit' => $new_limit, '!url' => 'http://drupal.org/node/207036'));
+  }
+
   return $requirements;
 }
 
