diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 9aecf35..0966ded 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -96,6 +96,16 @@ abstract class DrupalTestCase {
   }
 
   /**
+   * Checks the matching requirements for DrupalTestCase.
+   *
+   * @return
+   *   Array of errors containing a list of unmet requirements.
+   */
+  protected function checkRequirements() {
+    return array();
+  }
+
+  /**
    * Internal helper: stores the assert.
    *
    * @param $status
@@ -481,34 +491,46 @@ abstract class DrupalTestCase {
     if ($methods) {
       $class_methods = array_intersect($class_methods, $methods);
     }
-    foreach ($class_methods as $method) {
-      // If the current method starts with "test", run it - it's a test.
-      if (strtolower(substr($method, 0, 4)) == 'test') {
-        // Insert a fail record. This will be deleted on completion to ensure
-        // that testing completed.
-        $method_info = new ReflectionMethod($class, $method);
-        $caller = array(
-          'file' => $method_info->getFileName(),
-          'line' => $method_info->getStartLine(),
-          'function' => $class . '->' . $method . '()',
-        );
-        $completion_check_id = DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
-        $this->setUp();
-        if ($this->setup) {
-          try {
-            $this->$method();
-            // Finish up.
+    $missing_requirements = $this->checkRequirements();
+    if (!empty($missing_requirements)) {
+      $missing_requirements_object = new ReflectionObject($this);
+      $caller = array(
+        'file' => $missing_requirements_object->getFileName(),
+      );
+      foreach ($missing_requirements as $missing_requirement) {
+        DrupalTestCase::insertAssert($this->testId, $class, FALSE, $missing_requirement, 'Requirements check.', $caller);
+      }
+    }
+    else {
+      foreach ($class_methods as $method) {
+        // If the current method starts with "test", run it - it's a test.
+        if (strtolower(substr($method, 0, 4)) == 'test') {
+          // Insert a fail record. This will be deleted on completion to ensure
+          // that testing completed.
+          $method_info = new ReflectionMethod($class, $method);
+          $caller = array(
+            'file' => $method_info->getFileName(),
+            'line' => $method_info->getStartLine(),
+            'function' => $class . '->' . $method . '()',
+          );
+          $completion_check_id = DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
+          $this->setUp();
+          if ($this->setup) {
+            try {
+              $this->$method();
+              // Finish up.
+            }
+            catch (Exception $e) {
+              $this->exceptionHandler($e);
+            }
+            $this->tearDown();
           }
-          catch (Exception $e) {
-            $this->exceptionHandler($e);
+          else {
+            $this->fail(t("The test cannot be executed because it has not been set up properly."));
           }
-          $this->tearDown();
-        }
-        else {
-          $this->fail(t("The test cannot be executed because it has not been set up properly."));
+          // Remove the completion check record.
+          DrupalTestCase::deleteAssert($completion_check_id);
         }
-        // Remove the completion check record.
-        DrupalTestCase::deleteAssert($completion_check_id);
       }
     }
     // Clear out the error messages and restore error handler.
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test
index dbe2ec0..3d90734 100644
--- a/modules/simpletest/simpletest.test
+++ b/modules/simpletest/simpletest.test
@@ -567,3 +567,52 @@ class SimpleTestBrokenSetUp extends DrupalWebTestCase {
     }
   }
 }
+
+/**
+ * Tests missing requirements to run test.
+ */
+class SimpleTestMissingCheckedRequirements extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Broken requirements test',
+      'description' => 'Tests a test case with missing requirements.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('simpletest');
+    $admin_user = $this->drupalCreateUser(array('administer unit tests'));
+    $this->drupalLogin($admin_user);
+  }
+
+  /**
+   * Overrides checkRequirements().
+   */
+  protected function checkRequirements() {
+    if (drupal_valid_test_ua()) {
+      return array(
+        'Test is not allowed to run.'
+      );
+    }
+    return parent::checkRequirements();
+  }
+
+  /**
+   * Ensures test will not run when requirements are missing.
+   */
+  protected function testCheckRequirements() {
+    // If this is the main request, run the web test script and then assert
+    // that the child tests did not run.
+    if (!drupal_valid_test_ua()) {
+      // Run this test from web interface.
+      $edit['SimpleTestMissingCheckedRequirements'] = TRUE;
+      $this->drupalPost('admin/config/development/testing', $edit, t('Run tests'));
+      $this->assertRaw('Test is not allowed to run.', 'Test check for requirements came up.');
+      $this->assertNoText('Test ran when it failed requirements check.', 'Test requirements stopped test from running.');
+    }
+    else {
+      $this->fail('Test ran when it failed requirements check.');
+    }
+  }
+}
diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test
index 60599be..daf5394 100644
--- a/modules/simpletest/tests/image.test
+++ b/modules/simpletest/tests/image.test
@@ -216,6 +216,16 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
     );
   }
 
+  protected function checkRequirements() {
+    image_get_available_toolkits();
+    if (!function_exists('image_gd_check_settings') || !image_gd_check_settings()) {
+      return array(
+        'Image manipulations for the GD toolkit cannot run because the GD toolkit is not available.',
+      );
+    }
+    return parent::checkRequirements();
+  }
+
   /**
    * Function to compare two colors by RGBa.
    */
@@ -254,12 +264,6 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
    * the expected height and widths for the final images.
    */
   function testManipulations() {
-    // If GD isn't available don't bother testing this.
-    if (!function_exists('image_gd_check_settings') || !image_gd_check_settings()) {
-      $this->pass(t('Image manipulations for the GD toolkit were skipped because the GD toolkit is not available.'));
-      return;
-    }
-
     // Typically the corner colors will be unchanged. These colors are in the
     // order of top-left, top-right, bottom-right, bottom-left.
     $default_corners = array($this->red, $this->green, $this->blue, $this->transparent);
diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test
index 2602b09..1105cef 100644
--- a/modules/simpletest/tests/upgrade/upgrade.test
+++ b/modules/simpletest/tests/upgrade/upgrade.test
@@ -71,17 +71,21 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Override of DrupalWebTestCase::setUp() specialized for upgrade testing.
+   * Checks that zlib is enabled in order to run the upgrade tests.
    */
-  protected function setUp() {
-    // We are going to set a missing zlib requirement property for usage
-    // during the performUpgrade() and tearDown() methods. Also set that the
-    // tests failed.
-    if (!$this->zlibInstalled) {
-      parent::setUp();
-      return;
+  protected function checkRequirements() {
+    if (!function_exists('gzopen')) {
+      return array(
+        'Missing zlib requirement for upgrade tests.',
+      );
     }
+    return parent::checkRequirements();
+  }
 
+  /**
+   * Override of DrupalWebTestCase::setUp() specialized for upgrade testing.
+   */
+  protected function setUp() {
     global $user, $language, $conf;
 
     // Load the Update API.
@@ -180,11 +184,6 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
   protected function tearDown() {
     global $user, $language;
 
-    if (!$this->zlibInstalled) {
-      parent::tearDown();
-      return;
-    }
-
     // In case a fatal error occurred that was not in the test process read the
     // log to pick up any fatal errors.
     simpletest_log_read($this->testId, $this->databasePrefix, get_class($this), TRUE);
@@ -279,11 +278,6 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
    *   TRUE if the upgrade succeeded, FALSE otherwise.
    */
   protected function performUpgrade($register_errors = TRUE) {
-    if (!$this->zlibInstalled) {
-      $this->fail(t('Missing zlib requirement for upgrade tests.'));
-      return FALSE;
-    }
-
     $update_url = $GLOBALS['base_url'] . '/update.php';
 
     // Load the first update screen.
