? .DS_Store
? simpletest
? tests/.DS_Store
? tests/translation_module.test
Index: run_all_tests.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/run_all_tests.php,v
retrieving revision 1.3
diff -u -p -r1.3 run_all_tests.php
--- run_all_tests.php	5 Apr 2006 00:44:32 -0000	1.3
+++ run_all_tests.php	16 Jan 2008 14:12:49 -0000
@@ -2,23 +2,29 @@
 
 // $Id: run_all_tests.php,v 1.3 2006/04/05 00:44:32 thomasilsche Exp $
 
-
-
 /**
-
  * @file
-
- * Run all unit tests for all enabled modules.
-
+ * This script can be run with browser or from command line.
+ * You can provide class names of the tests you wish to run.
+ * For command line: php run_all_tests.php SearchMatchTest,ProfileModuleTestSingle
+ * For browser: http://yoursite.com/sites/all/modules/simpletest/run_all_tests.php?include=SearchMatchTest,ProfileModuleTestSingle
+ * If none of these two options are provided all tests will be run.
  */
 chdir(realpath(dirname(__FILE__) . '/../../'));
-
-require_once './includes/bootstrap.inc';
+if (file_exists('./includes/bootstrap.inc')) {
+  include_once './includes/bootstrap.inc';
+}
+else {
+  chdir(getcwd() . '/../../');
+  if (file_exists('./includes/bootstrap.inc')) {
+    include_once './includes/bootstrap.inc';
+  }
+  else {
+  	exit("bootstrap.inc could not be loaded\n");
+}
 
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
-
-
 // If not in 'safe mode', increase the maximum execution time:
 
 if (!ini_get('safe_mode')) {
@@ -26,8 +32,14 @@ if (!ini_get('safe_mode')) {
   set_time_limit(360);
 
 }
-
-
-
-simpletest_run_tests();
+$tests = array();
+$html_reporter = FALSE;
+if ($_GET['include']) {
+  $tests = explode(',', $_GET['include']);
+  $html_reporter = TRUE;
+}
+else if ($argc == 2) {
+  $tests = explode(',', $argv[1]);
+}
+simpletest_run_tests($tests, $html_reporter);
 
Index: simpletest.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.module,v
retrieving revision 1.32
diff -u -p -r1.32 simpletest.module
--- simpletest.module	11 Jan 2008 17:03:04 -0000	1.32
+++ simpletest.module	16 Jan 2008 14:12:49 -0000
@@ -189,21 +189,38 @@ function simpletest_overview_form() {
 /**
  * Actually runs tests
  * @param array $testlist list of tests to run or DEFAULT NULL run all tests
+ * @param boolean $html_reporter true if you want results in simple html, FALSE for full drupal page
  */
-function simpletest_run_tests($testlist = NULL) {
+function simpletest_run_tests($testlist = NULL, $html_reporter = FALSE) {
   global $test_running;
   if (!$test_running) {
     $test_running = TRUE;
     $test = simpletest_get_total_test($testlist);
     if (SimpleReporter::inCli()) {
       cache_clear_all();
+      $reporter = &new TextReporter();
+      $reporter_type = 1;
       exit ($test->run(new TextReporter()) ? 0 : 1);
     }
-    $reporter = &new DrupalReporter();
+    else if ($html_reporter == TRUE) {
+      $reporter = &new HtmlReporter();
+      $reporter_type = 2;
+    }
+    else {
+      $reporter = &new DrupalReporter();
+      $reporter_type = 3;
+    }
     cache_clear_all();
-    $test->run($reporter);
+    $results = $test->run($reporter);
     $test_running = FALSE;
-    return $reporter->getOutput();
+    switch ($reporter_type) {
+      case 1:
+        exit ($results ? 0 : 1);
+      case 2:
+      	break;
+      case 3:
+        return $reporter->getOutput();
+    }
   }
 }
 
