Test: Add USE_STDIO option for test logs

The clients like RPC test framework hosts may use the stdio provided by
toolchain.
This patch adds this config option for test log.
It also removes the unncessary inclusions of <stdio.h>.
They are partially for the log function and the rest for the <stddef.h>
which is included by stdio.h.

Change-Id: I79328d50b43e6c0b0d7ed55296c9973a90cb90e1
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/tests_reg/test/framework/test_framework.c b/tests_reg/test/framework/test_framework.c
index f9a5c4d..b9693b1 100644
--- a/tests_reg/test/framework/test_framework.c
+++ b/tests_reg/test/framework/test_framework.c
@@ -8,7 +8,6 @@
 #include "test_framework.h"
 
 #include <assert.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/tests_reg/test/framework/test_framework.h b/tests_reg/test/framework/test_framework.h
index c01c34d..ef614df 100644
--- a/tests_reg/test/framework/test_framework.h
+++ b/tests_reg/test/framework/test_framework.h
@@ -10,7 +10,6 @@
 
 #include <stdarg.h>
 #include <stdint.h>
-#include <stdio.h>
 
 #include "test_log.h"
 #include "test_framework_helpers.h"
diff --git a/tests_reg/test/framework/test_framework_helpers.c b/tests_reg/test/framework/test_framework_helpers.c
index a467a04..25a010f 100644
--- a/tests_reg/test/framework/test_framework_helpers.c
+++ b/tests_reg/test/framework/test_framework_helpers.c
@@ -7,8 +7,6 @@
 
 #include "test_framework_helpers.h"
 
-#include <stdio.h>
-
 void printf_set_color(enum serial_color_t color_id)
 {
     TEST_LOG("\33[%dm", color_id);
diff --git a/tests_reg/test/framework/test_framework_integ_test_helper.c b/tests_reg/test/framework/test_framework_integ_test_helper.c
index 3d0eefd..18dba96 100644
--- a/tests_reg/test/framework/test_framework_integ_test_helper.c
+++ b/tests_reg/test/framework/test_framework_integ_test_helper.c
@@ -5,7 +5,7 @@
  *
  */
 
-#include <stdio.h>
+#include <stddef.h>
 
 #include "test_framework.h"
 #include "test_framework_integ_test_helper.h"
diff --git a/tests_reg/test/framework/test_log.h b/tests_reg/test/framework/test_log.h
index 1fc0b3d..995f726 100644
--- a/tests_reg/test/framework/test_log.h
+++ b/tests_reg/test/framework/test_log.h
@@ -10,6 +10,8 @@
 
 #ifdef USE_SP_LOG
 #include "tfm_sp_log.h"
+#elif defined USE_STDIO
+#include <stdio.h>
 #else
 #include "tfm_log_raw.h"
 #endif /* USE_SP_LOG */
@@ -18,7 +20,7 @@
 extern "C" {
 #endif
 
-#ifdef USE_SP_LOG
+#if defined USE_SP_LOG || USE_STDIO
 #define TEST_LOG(...) printf(__VA_ARGS__)
 #else
 #define TEST_LOG(...) tfm_log_printf(__VA_ARGS__)