Index: simpletest.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.module,v
retrieving revision 1.33.2.4.2.23
diff -u -p -r1.33.2.4.2.23 simpletest.module
--- simpletest.module	7 Oct 2010 21:50:06 -0000	1.33.2.4.2.23
+++ simpletest.module	12 Nov 2010 00:27:20 -0000
@@ -384,19 +384,27 @@ function simpletest_test_get_all() {
           // Valid test class, retrieve test information.
           $info = call_user_func(array($class, 'getInfo'));
 
-          // Initialize test groups.
-          if (!isset($groups[$info['group']])) {
-            $groups[$info['group']] = array();
+          // If this test class requires a non-existing module, skip it.
+          if (!empty($info['dependencies'])) {
+            foreach ($info['dependencies'] as $module) {
+              if (!drupal_get_filename('module', $module)) {
+                continue 2;
+              }
+            }
           }
+
           $groups[$info['group']][$class] = $info;
         }
       }
+
       // Sort the groups and tests within the groups by name.
       uksort($groups, 'strnatcasecmp');
       foreach ($groups as $group => &$tests) {
         uksort($tests, 'strnatcasecmp');
       }
 
+      // Allow modules extending core tests to disable originals.
+      drupal_alter('simpletest', $groups);
       cache_set('simpletest', $groups);
     }
   }
@@ -623,4 +631,3 @@ function simpletest_form_system_modules_
     }
   }
 }
-
Index: simpletest.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.test,v
retrieving revision 1.1.2.18
diff -u -p -r1.1.2.18 simpletest.test
--- simpletest.test	13 Oct 2010 21:23:51 -0000	1.1.2.18
+++ simpletest.test	12 Nov 2010 00:27:20 -0000
@@ -361,3 +361,23 @@ class SimpleTestMailCaptureTestCase exte
   }
 }
 
+/**
+ * Test required modules for tests.
+ */
+class SimpleTestMissingDependentModuleUnitTest extends DrupalUnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Testing dependent module test',
+      'description' => 'This test should not load since it requires a module that is not found.',
+      'group' => 'SimpleTest',
+      'dependencies' => array('simpletest_missing_module'),
+    );
+  }
+
+  /**
+   * Ensure that this test will not be loaded despite its dependency.
+   */
+  function testFail() {
+    $this->fail(t('Running test with missing required module.'));
+  }
+}

