diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index ac3ba0cb483d38011d35205a258dcc847cd5c000..4e35b28ab0551b54e4931165c168f3670dd18a21 100644
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -41,6 +41,20 @@
   exit;
 }
 
+if ($args['list']) {
+  // Display all available tests.
+  echo "\nAvailable test groups & classes\n";
+  echo   "-------------------------------\n\n";
+  $groups = simpletest_test_get_all($args['module']);
+  foreach ($groups as $group => $tests) {
+    echo $group . "\n";
+    foreach ($tests as $class => $info) {
+      echo " - $class\n";
+    }
+  }
+  exit;
+}
+
 simpletest_script_setup_database(TRUE);
 
 if ($args['clean']) {
@@ -56,20 +70,6 @@
   exit;
 }
 
-if ($args['list']) {
-  // Display all available tests.
-  echo "\nAvailable test groups & classes\n";
-  echo   "-------------------------------\n\n";
-  $groups = simpletest_test_get_all($args['module']);
-  foreach ($groups as $group => $tests) {
-    echo $group . "\n";
-    foreach ($tests as $class => $info) {
-      echo " - $class\n";
-    }
-  }
-  exit;
-}
-
 $test_list = simpletest_script_get_test_list();
 
 // Try to allocate unlimited time to run the tests.