diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 30087ef..9d08892 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -618,7 +618,8 @@ function simpletest_script_cleanup($test_id, $test_class, $exitcode) {
  *
  * Will print error and exit if no valid tests were found.
  *
- * @return List of tests.
+ * @return array
+ *   List of tests keyed by group. If no group available
  */
 function simpletest_script_get_test_list() {
   global $args;
@@ -634,8 +635,9 @@ function simpletest_script_get_test_list() {
   }
   else {
     if ($args['class']) {
+      $test_list['classes'] = array();
       foreach ($args['test_names'] as $class_name) {
-        $test_list[] = $class_name;
+        $test_list['classes'][] = $class_name;
       }
     }
     elseif ($args['module']) {
@@ -647,8 +649,9 @@ function simpletest_script_get_test_list() {
           'key' => 'name',
           'recurse' => TRUE,
         ));
+        $test_list[$module] = array();
         foreach ($files as $test => $file) {
-          $test_list[] = "Drupal\\$module\\Tests\\$test";
+          $test_list[$module] = "Drupal\\$module\\Tests\\$test";
         }
       }
     }
