[Xenomai-git] Philippe Gerum : lib/smokey, testsuite/smokey: issue terminating newline on note/warning

2015-06-29 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 623f072be3e37f8a3aa6b03f92a63480c63a2ba5
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=623f072be3e37f8a3aa6b03f92a63480c63a2ba5

Author: Philippe Gerum 
Date:   Sat Jun 20 10:39:54 2015 +0200

lib/smokey, testsuite/smokey: issue terminating newline on note/warning

---

 include/smokey/smokey.h  |4 ++--
 lib/smokey/helpers.c |5 -
 lib/smokey/init.c|5 +++--
 testsuite/smokey/Makefile.am |4 ++--
 testsuite/smokey/bufp/bufp.c |4 ++--
 testsuite/smokey/iddp/iddp.c |4 ++--
 testsuite/smokey/main.c  |4 ++--
 testsuite/smokey/sigdebug/sigdebug.c |   16 
 testsuite/smokey/xddp/xddp.c |6 +++---
 9 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index d8aa9d8..bf968f7 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -102,7 +102,7 @@ struct smokey_test {
int __ret = (__expr);   \
if (__ret < 0) {\
__ret = -errno; \
-   smokey_warning(__FILE__, __LINE__, "%s: %s\n",  \
+   smokey_warning(__FILE__, __LINE__, "%s: %s",\
   #__expr, strerror(errno));   \
}   \
__ret;  \
@@ -113,7 +113,7 @@ struct smokey_test {
int __ret = (__expr);   \
if (!__ret) \
smokey_warning(__FILE__, __LINE__,  \
-  "assertion failed: %s\n", #__expr); \
+  "assertion failed: %s", #__expr); \
__ret;  \
})
 
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 53ff879..cef86aa 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -124,8 +124,10 @@ void smokey_note(const char *fmt, ...)
 
va_start(ap, fmt);
 
-   if (smokey_verbose_mode)
+   if (smokey_verbose_mode) {
__RT(vfprintf(stdout, fmt, ap));
+   __RT(fprintf(stdout, "\n"));
+   }
 
va_end(ap);
 }
@@ -140,6 +142,7 @@ void smokey_warning(const char *file, int lineno,
if (smokey_verbose_mode) {
__RT(fprintf(stderr, "%s:%d, ", basename(file), lineno));
__RT(vfprintf(stderr, fmt, ap));
+   __RT(fprintf(stdout, "\n"));
}
 
va_end(ap);
diff --git a/lib/smokey/init.c b/lib/smokey/init.c
index c6dfa79..876fc0d 100644
--- a/lib/smokey/init.c
+++ b/lib/smokey/init.c
@@ -203,7 +203,8 @@
  *
  * The printf-like @a smokey_note() routine is available for issuing
  * progress messages to the output device (currently stdout), unless
- * --silent was detected on the command line.
+ * --silent was detected on the command line. smokey_note() outputs
+ * a terminating newline character.
  *
  * Therefore, a possible implementation of a test driver could be as
  * basic as:
@@ -228,7 +229,7 @@
  * continue;
  * error(1, -ret, "test %s failed", t->name);
  * }
- * smokey_note("%s OK\n", t->name);
+ * smokey_note("%s OK", t->name);
  * }
  *
  * return 0;
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index f5a866c..b1a6426 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -10,7 +10,7 @@ wrappers = $(XENO_POSIX_WRAPPERS)
 SUBDIRS =  \
arith   \
bufp\
-   clock   \
+   posix-clock  \
cond-torture\
fork-exec   \
iddp\
@@ -50,7 +50,7 @@ smokey_LDADD =\
 DIST_SUBDIRS = \
arith   \
bufp\
-   clock   \
+   posix-clock \
cond-torture\
fork-exec   \
iddp\
diff --git a/testsuite/smokey/bufp/bufp.c b/testsuite/smokey/bufp/bufp.c
index d839f44..14ff033 100644
--- a/testsuite/smokey/bufp/bufp.c
+++ b/testsuite/smokey/bufp/bufp.c
@@ -83,7 +83,7 @@ static void *server(void *arg)
errno = -EINVAL;
fail("recvfrom");
}
-   smokey_note("%s: received %d bytes, %ld from port %d\n",
+   smokey_note("%s: received %d bytes, %ld from port %d",
  __FUNCTION__, ret, data, claddr.sipc_port);
}
 
@@ -123,7 +123,7 @@ static void *client(void *arg)

[Xenomai-git] Philippe Gerum : lib/smokey, testsuite/smokey: issue terminating newline on note/warning

2015-06-20 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 623f072be3e37f8a3aa6b03f92a63480c63a2ba5
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=623f072be3e37f8a3aa6b03f92a63480c63a2ba5

Author: Philippe Gerum 
Date:   Sat Jun 20 10:39:54 2015 +0200

lib/smokey, testsuite/smokey: issue terminating newline on note/warning

---

 include/smokey/smokey.h  |4 ++--
 lib/smokey/helpers.c |5 -
 lib/smokey/init.c|5 +++--
 testsuite/smokey/Makefile.am |4 ++--
 testsuite/smokey/bufp/bufp.c |4 ++--
 testsuite/smokey/iddp/iddp.c |4 ++--
 testsuite/smokey/main.c  |4 ++--
 testsuite/smokey/sigdebug/sigdebug.c |   16 
 testsuite/smokey/xddp/xddp.c |6 +++---
 9 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index d8aa9d8..bf968f7 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -102,7 +102,7 @@ struct smokey_test {
int __ret = (__expr);   \
if (__ret < 0) {\
__ret = -errno; \
-   smokey_warning(__FILE__, __LINE__, "%s: %s\n",  \
+   smokey_warning(__FILE__, __LINE__, "%s: %s",\
   #__expr, strerror(errno));   \
}   \
__ret;  \
@@ -113,7 +113,7 @@ struct smokey_test {
int __ret = (__expr);   \
if (!__ret) \
smokey_warning(__FILE__, __LINE__,  \
-  "assertion failed: %s\n", #__expr); \
+  "assertion failed: %s", #__expr); \
__ret;  \
})
 
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 53ff879..cef86aa 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -124,8 +124,10 @@ void smokey_note(const char *fmt, ...)
 
va_start(ap, fmt);
 
-   if (smokey_verbose_mode)
+   if (smokey_verbose_mode) {
__RT(vfprintf(stdout, fmt, ap));
+   __RT(fprintf(stdout, "\n"));
+   }
 
va_end(ap);
 }
@@ -140,6 +142,7 @@ void smokey_warning(const char *file, int lineno,
if (smokey_verbose_mode) {
__RT(fprintf(stderr, "%s:%d, ", basename(file), lineno));
__RT(vfprintf(stderr, fmt, ap));
+   __RT(fprintf(stdout, "\n"));
}
 
va_end(ap);
diff --git a/lib/smokey/init.c b/lib/smokey/init.c
index c6dfa79..876fc0d 100644
--- a/lib/smokey/init.c
+++ b/lib/smokey/init.c
@@ -203,7 +203,8 @@
  *
  * The printf-like @a smokey_note() routine is available for issuing
  * progress messages to the output device (currently stdout), unless
- * --silent was detected on the command line.
+ * --silent was detected on the command line. smokey_note() outputs
+ * a terminating newline character.
  *
  * Therefore, a possible implementation of a test driver could be as
  * basic as:
@@ -228,7 +229,7 @@
  * continue;
  * error(1, -ret, "test %s failed", t->name);
  * }
- * smokey_note("%s OK\n", t->name);
+ * smokey_note("%s OK", t->name);
  * }
  *
  * return 0;
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index f5a866c..b1a6426 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -10,7 +10,7 @@ wrappers = $(XENO_POSIX_WRAPPERS)
 SUBDIRS =  \
arith   \
bufp\
-   clock   \
+   posix-clock  \
cond-torture\
fork-exec   \
iddp\
@@ -50,7 +50,7 @@ smokey_LDADD =\
 DIST_SUBDIRS = \
arith   \
bufp\
-   clock   \
+   posix-clock \
cond-torture\
fork-exec   \
iddp\
diff --git a/testsuite/smokey/bufp/bufp.c b/testsuite/smokey/bufp/bufp.c
index d839f44..14ff033 100644
--- a/testsuite/smokey/bufp/bufp.c
+++ b/testsuite/smokey/bufp/bufp.c
@@ -83,7 +83,7 @@ static void *server(void *arg)
errno = -EINVAL;
fail("recvfrom");
}
-   smokey_note("%s: received %d bytes, %ld from port %d\n",
+   smokey_note("%s: received %d bytes, %ld from port %d",
  __FUNCTION__, ret, data, claddr.sipc_port);
}
 
@@ -123,7 +123,7 @@ static void *client(void *arg)