Fix defects in remote test runner

While checking operation of the env_test SP, a couple of defects
in components built into the ts-remote-test deployment were observed.
The missing list tests functionality is added (-l option) and a regression
caused by a previous introduction of the 64-bit rpc_opstatus_t type that
meant that the list of test results wasn't printed is fixed.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I6ba92c939da167c12376709e75b6dbdbbb4f3a2b
diff --git a/components/app/remote-test-runner/remote_test_runner.cpp b/components/app/remote-test-runner/remote_test_runner.cpp
index b819779..66d81f6 100644
--- a/components/app/remote-test-runner/remote_test_runner.cpp
+++ b/components/app/remote-test-runner/remote_test_runner.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -46,19 +46,21 @@
     struct test_summary summary;
     std::vector<struct test_result> results;
 
-    if (list_only) {
+    memset(&summary, 0, sizeof(summary));
 
-        test_status = m_client->list_tests(spec, summary, results);
-        output_list(summary, results);
+    test_status = (list_only) ?
+        m_client->list_tests(spec, summary, results) :
+        m_client->run_tests(spec, summary, results);
+
+    if (test_status == TS_TEST_RUNNER_STATUS_SUCCESS) {
+
+        if (list_only)
+            output_list(summary, results);
+        else
+            output_results(summary, results);
     }
     else {
 
-        test_status = m_client->run_tests(spec, summary, results);
-        output_results(summary, results);
-    }
-
-    if (test_status != TS_TEST_RUNNER_STATUS_SUCCESS) {
-
         printf("Tests failed to run with error: %d\n", test_status);
     }
 
@@ -119,7 +121,12 @@
 void remote_test_runner::output_list(const struct test_summary &summary,
                                     const std::vector<struct test_result> &results)
 {
+    for (int i = 0; i < results.size(); ++i) {
 
+        printf("TEST(%s, %s)\n", results[i].group, results[i].name);
+    }
+
+    output_summary(summary);
 }
 
 void remote_test_runner::output_results(const struct test_summary &summary,