[PATCH] testsuites: Add TESTS_USE_PRINTF

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Feb 11 16:41:29 UTC 2014


Make it possible to use normal printf() if requested to allow output of
floating point numbers.
---
 testsuites/support/include/buffer_test_io.h |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/testsuites/support/include/buffer_test_io.h b/testsuites/support/include/buffer_test_io.h
index e0eb24d..465ae05 100644
--- a/testsuites/support/include/buffer_test_io.h
+++ b/testsuites/support/include/buffer_test_io.h
@@ -139,7 +139,7 @@ extern "C" {
 /*
  *  USE IPRINT
  */
-#else
+#elif !defined(TESTS_USE_PRINTF)
 
   #include <stdio.h>
   #include <stdlib.h>
@@ -181,6 +181,21 @@ extern "C" {
       fflush(stdout); \
     } while (0)
 
+#else
+
+  #include <stdio.h>
+  #include <stdlib.h>
+
+  #define rtems_test_exit(_s) \
+    do { \
+      exit(_s); \
+    } while (0)
+
+  #define FLUSH_OUTPUT() \
+    do { \
+      fflush(stdout); \
+    } while (0)
+
 #endif
 
 #ifdef __cplusplus
-- 
1.7.7




More information about the devel mailing list