Index: scripts/run-tests.sh
===================================================================
RCS file: /cvs/drupal/drupal/scripts/run-tests.sh,v
retrieving revision 1.37
diff -u -r1.37 run-tests.sh
--- scripts/run-tests.sh	10 Nov 2009 17:27:54 -0000	1.37
+++ scripts/run-tests.sh	10 Dec 2009 22:24:52 -0000
@@ -113,7 +113,8 @@
   --list      Display all available test groups.
 
   --clean     Cleans up database tables or directories from previous, failed,
-              tests and then exits (no tests are run).
+              tests and then exits (no tests are run). This also clears
+              SimpleTest's cache.
 
   --url       Immediately preceeds a URL to set the host and path. You will
               need this parameter if Drupal is in a subdirectory on your
@@ -149,8 +150,8 @@
               specific test classes whose test methods will be run. Tests must
               be separated by commas. Ignored if --all is specified.
 
-To run this script you will normally invoke it from the root directory of your
-Drupal installation as the webserver user (differs per configuration), or root:
+To run this script you will normally invoke it as the webserver user (differs
+per configuration):
 
 sudo -u [wwwrun|www-data|etc] php ./scripts/{$args['script']}
   --url http://example.com/ --all
@@ -366,11 +367,16 @@
 function simpletest_script_command($concurrency, $test_id, $tests) {
   global $args, $php;
 
-  $command = "$php ./scripts/{$args['script']} --url {$args['url']}";
+  $command = "$php " . escapeshellarg("./scripts/{$args['script']}");
+  $commmand .= ' --url ' . escapeshellarg($args['url']);
   if ($args['color']) {
     $command .= ' --color';
   }
-  $command .= " --php " . escapeshellarg($php) . " --concurrency $concurrency --test-id $test_id --execute-batch $tests";
+  $command .= " --php " . escapeshellarg($php);
+  $command .= " --concurrency " . escapeshellarg($concurrency);
+  $command .= " --test-id " . escapeshellarg($test_id);
+  $command .= " --execute-batch " . escapeshellarg($tests);
+
   passthru($command);
 }
 
