=== modified file 'modules/simpletest/drupal_web_test_case.php'
--- modules/simpletest/drupal_web_test_case.php	2009-05-03 20:01:11 +0000
+++ modules/simpletest/drupal_web_test_case.php	2009-05-16 20:25:42 +0000
@@ -854,62 +854,66 @@ class DrupalWebTestCase {
    * is created with the same name as the database prefix.
    *
    * @param ...
-   *   List of modules to enable for the duration of the test.
+   *   List of modules to enable for the duration of the test or FALSE to
+   *   avoid installing Drupal. Only use FALSE if your test does not change
+   *   anything in the database and does not write files. Such tests will see
+   *   a significant speedup from FALSE.
    */
   protected function setUp() {
     global $db_prefix, $user;
 
+    $args = func_get_args();
     // Store necessary current values before switching to prefixed database.
     $this->originalPrefix = $db_prefix;
-    $this->originalFileDirectory = file_directory_path();
-    $clean_url_original = variable_get('clean_url', 0);
-
-    // Generate temporary prefixed database to ensure that tests have a clean starting point.
-    $db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}');
-
-    include_once DRUPAL_ROOT . '/includes/install.inc';
-    drupal_install_system();
-
-    $this->preloadRegistry();
-
-    // Add the specified modules to the list of modules in the default profile.
-    $args = func_get_args();
-    $modules = array_unique(array_merge(drupal_get_profile_modules('default', 'en'), $args));
-    drupal_install_modules($modules, TRUE);
-
-    // Because the schema is static cached, we need to flush
-    // it between each run. If we don't, then it will contain
-    // stale data for the previous run's database prefix and all
-    // calls to it will fail.
-    drupal_get_schema(NULL, TRUE);
-
-    // Run default profile tasks.
-    $task = 'profile';
-    default_profile_tasks($task, '');
-
-    // Rebuild caches.
-    actions_synchronize();
-    _drupal_flush_css_js();
-    $this->refreshVariables();
-    $this->checkPermissions(array(), TRUE);
-
-    // Log in with a clean $user.
-    $this->originalUser = $user;
-    drupal_save_session(FALSE);
-    $user = user_load(1);
-
-    // Restore necessary variables.
-    variable_set('install_profile', 'default');
-    variable_set('install_task', 'profile-finished');
-    variable_set('clean_url', $clean_url_original);
-    variable_set('site_mail', 'simpletest@example.com');
-
-    // Use temporary files directory with the same prefix as database.
-    variable_set('file_directory_path', $this->originalFileDirectory . '/' . $db_prefix);
-    $directory = file_directory_path();
-    // Create the files directory.
-    file_check_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
-
+    if ($args && $args[0] !== FALSE) {
+      $this->originalFileDirectory = file_directory_path();
+      $clean_url_original = variable_get('clean_url', 0);
+  
+      // Generate temporary prefixed database to ensure that tests have a clean starting point.
+      $db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}');
+  
+      include_once DRUPAL_ROOT . '/includes/install.inc';
+      drupal_install_system();
+  
+      $this->preloadRegistry();
+  
+      // Add the specified modules to the list of modules in the default profile.
+      $modules = array_unique(array_merge(drupal_get_profile_modules('default', 'en'), $args));
+      drupal_install_modules($modules, TRUE);
+  
+      // Because the schema is static cached, we need to flush
+      // it between each run. If we don't, then it will contain
+      // stale data for the previous run's database prefix and all
+      // calls to it will fail.
+      drupal_get_schema(NULL, TRUE);
+  
+      // Run default profile tasks.
+      $task = 'profile';
+      default_profile_tasks($task, '');
+  
+      // Rebuild caches.
+      actions_synchronize();
+      _drupal_flush_css_js();
+      $this->refreshVariables();
+      $this->checkPermissions(array(), TRUE);
+  
+      // Log in with a clean $user.
+      $this->originalUser = $user;
+      drupal_save_session(FALSE);
+      $user = user_load(1);
+  
+      // Restore necessary variables.
+      variable_set('install_profile', 'default');
+      variable_set('install_task', 'profile-finished');
+      variable_set('clean_url', $clean_url_original);
+      variable_set('site_mail', 'simpletest@example.com');
+  
+      // Use temporary files directory with the same prefix as database.
+      variable_set('file_directory_path', $this->originalFileDirectory . '/' . $db_prefix);
+      $directory = file_directory_path();
+      // Create the files directory.
+      file_check_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
+    }
     set_time_limit($this->timeLimit);
   }
 

=== modified file 'modules/simpletest/tests/graph.test'
--- modules/simpletest/tests/graph.test	2009-04-11 17:58:17 +0000
+++ modules/simpletest/tests/graph.test	2009-05-16 20:08:03 +0000
@@ -17,6 +17,10 @@ class GraphUnitTest extends DrupalWebTes
       'group' => t('System'),
     );
   }
+  
+  function setUp() {
+    parent::setUp(FALSE);
+  }
 
   /**
    * Test depth-first-search features.

=== modified file 'modules/simpletest/tests/registry.test'
--- modules/simpletest/tests/registry.test	2009-05-16 16:04:42 +0000
+++ modules/simpletest/tests/registry.test	2009-05-16 20:13:37 +0000
@@ -144,10 +144,15 @@ class RegistrySkipBodyTestCase extends D
     );
   }
   
+  function setUp() {
+    parent::setUp(FALSE);
+  }
+  
   function testRegistrySkipBody () {
     // This string contains all three kinds of opening braces.
     $function = '<?php function foo () { $x = "{$y}"; $x = "${y}"; }';
     $tokens = token_get_all($function);
+    drupal_function_exists('_registry_skip_body');
     _registry_skip_body($tokens);
     // Consume the last }
     each($tokens);

