[Xenomai-git] Philippe Gerum : testsuite/smokey: add POSIX select testing code

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 11:58:00 2015 +0200

testsuite/smokey: add POSIX select testing code

---

 configure.ac   |1 +
 include/smokey/smokey.h|   11 ++
 testsuite/regression/posix/Makefile.am |1 -
 testsuite/smokey/Makefile.am   |2 +
 testsuite/smokey/posix-select/Makefile.am  |   10 ++
 .../posix-select/posix-select.c}   |  105 
 6 files changed, 88 insertions(+), 42 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7abd18c..c9aed45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -931,6 +931,7 @@ AC_CONFIG_FILES([ \
testsuite/smokey/posix-mutex/Makefile \
testsuite/smokey/posix-clock/Makefile \
testsuite/smokey/posix-fork/Makefile \
+   testsuite/smokey/posix-select/Makefile \
testsuite/smokey/xddp/Makefile \
testsuite/smokey/iddp/Makefile \
testsuite/smokey/bufp/Makefile \
diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index bf968f7..0a7b5e9 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -108,6 +108,17 @@ struct smokey_test {
__ret;  \
})
 
+#define smokey_check_status(__expr)\
+   ({  \
+   int __ret = (__expr);   \
+   if (__ret) {\
+   smokey_warning(__FILE__, __LINE__, %s: %s,\
+  #__expr, strerror(__ret));   \
+   __ret = -__ret; \
+   }   \
+   __ret;  \
+   })
+
 #define smokey_assert(__expr)  \
({  \
int __ret = (__expr);   \
diff --git a/testsuite/regression/posix/Makefile.am 
b/testsuite/regression/posix/Makefile.am
index f78c244..c878630 100644
--- a/testsuite/regression/posix/Makefile.am
+++ b/testsuite/regression/posix/Makefile.am
@@ -6,7 +6,6 @@ noinst_HEADERS = check.h
 
 test_PROGRAMS = \
leaks \
-   mq_select \
timerfd
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 2229871..397872e 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -15,6 +15,7 @@ SUBDIRS = \
posix-cond  \
posix-fork  \
posix-mutex \
+   posix-select\
rtdm\
sched-quota \
sched-tp\
@@ -55,6 +56,7 @@ DIST_SUBDIRS =\
posix-cond  \
posix-fork  \
posix-mutex \
+   posix-select\
rtdm\
sched-quota \
sched-tp\
diff --git a/testsuite/smokey/posix-select/Makefile.am 
b/testsuite/smokey/posix-select/Makefile.am
new file mode 100644
index 000..40b8839
--- /dev/null
+++ b/testsuite/smokey/posix-select/Makefile.am
@@ -0,0 +1,10 @@
+
+noinst_LIBRARIES = libposix-select.a
+
+libposix_select_a_SOURCES = posix-select.c
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+libposix_select_a_CPPFLAGS =   \
+   @XENO_USER_CFLAGS@  \
+   -I$(top_srcdir)/include
diff --git a/testsuite/regression/posix/mq_select.c 
b/testsuite/smokey/posix-select/posix-select.c
similarity index 55%
rename from testsuite/regression/posix/mq_select.c
rename to testsuite/smokey/posix-select/posix-select.c
index f0882bb..18a2b6b 100644
--- a/testsuite/regression/posix/mq_select.c
+++ b/testsuite/smokey/posix-select/posix-select.c
@@ -20,21 +20,21 @@
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include time.h
 #include errno.h
-
 #include unistd.h
-#include signal.h
 #include mqueue.h
 #include pthread.h
 #include sys/select.h
-#include sys/mman.h
+#include smokey/smokey.h
 
-#include check.h
+smokey_test_plugin(posix_select,
+  SMOKEY_NOARGS,
+  Check POSIX select service
+);
 
 static const char *tunes[] = {
 Surfing With The Alien,
@@ -55,64 +55,87 @@ static const char *tunes[] = {
 Engines Of Creation
 };
 
-static void *task(void *cookie)
+static int test_status;
+
+static void *mq_thread(void 

[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 r...@xenomai.org
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: add warning and assertion helpers

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 10:45:21 2015 +0200

lib/smokey: add warning and assertion helpers

---

 include/smokey/smokey.h |   23 +++
 lib/smokey/helpers.c|   15 +++
 2 files changed, 38 insertions(+)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index e759806..d8aa9d8 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -97,6 +97,26 @@ struct smokey_test {
 #define SMOKEY_ARG_BOOL(__plugin, __arg)   (!!SMOKEY_ARG_INT(__plugin, __arg))
 #define SMOKEY_ARG_STRING(__plugin, __arg) (SMOKEY_ARG(__plugin, 
__arg)-u.s_val)
 
+#define smokey_check_errno(__expr) \
+   ({  \
+   int __ret = (__expr);   \
+   if (__ret  0) {\
+   __ret = -errno; \
+   smokey_warning(__FILE__, __LINE__, %s: %s\n,  \
+  #__expr, strerror(errno));   \
+   }   \
+   __ret;  \
+   })
+
+#define smokey_assert(__expr)  \
+   ({  \
+   int __ret = (__expr);   \
+   if (!__ret) \
+   smokey_warning(__FILE__, __LINE__,  \
+  assertion failed: %s\n, #__expr); \
+   __ret;  \
+   })
+
 #ifdef __cplusplus
 extern C {
 #endif
@@ -117,6 +137,9 @@ int smokey_parse_args(struct smokey_test *t,
 
 void smokey_note(const char *fmt, ...);
 
+void smokey_warning(const char *file, int lineno,
+   const char *fmt, ...);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 21b0084..53ff879 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -129,3 +129,18 @@ void smokey_note(const char *fmt, ...)
 
va_end(ap);
 }
+
+void smokey_warning(const char *file, int lineno,
+   const char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+
+   if (smokey_verbose_mode) {
+   __RT(fprintf(stderr, %s:%d, , basename(file), lineno));
+   __RT(vfprintf(stderr, fmt, ap));
+   }
+
+   va_end(ap);
+}


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : testsuite/smokey: convert notes to traces when appropriate

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 15:13:01 2015 +0200

testsuite/smokey: convert notes to traces when appropriate

smokey --verbose=2 or higher turns on traces.

---

 testsuite/smokey/bufp/bufp.c |6 +++---
 testsuite/smokey/iddp/iddp.c |6 +++---
 testsuite/smokey/posix-clock/posix-clock.c   |   12 ++--
 testsuite/smokey/posix-select/posix-select.c |2 +-
 testsuite/smokey/sigdebug/sigdebug.c |   14 +++---
 testsuite/smokey/timerfd/timerfd.c   |   12 ++--
 testsuite/smokey/xddp/xddp.c |8 
 7 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/testsuite/smokey/bufp/bufp.c b/testsuite/smokey/bufp/bufp.c
index 14ff033..638cde9 100644
--- a/testsuite/smokey/bufp/bufp.c
+++ b/testsuite/smokey/bufp/bufp.c
@@ -83,8 +83,8 @@ static void *server(void *arg)
errno = -EINVAL;
fail(recvfrom);
}
-   smokey_note(%s: received %d bytes, %ld from port %d,
- __FUNCTION__, ret, data, claddr.sipc_port);
+   smokey_trace(%s: received %d bytes, %ld from port %d,
+__FUNCTION__, ret, data, claddr.sipc_port);
}
 
return NULL;
@@ -123,7 +123,7 @@ static void *client(void *arg)
close(s);
fail(sendto);
}
-   smokey_note(%s: sent %d bytes, %ld, __FUNCTION__, ret, data);
+   smokey_trace(%s: sent %d bytes, %ld, __FUNCTION__, ret, data);
ts.tv_sec = 0;
ts.tv_nsec = 1; /* 100 ms */
clock_nanosleep(CLOCK_REALTIME, 0, ts, NULL);
diff --git a/testsuite/smokey/iddp/iddp.c b/testsuite/smokey/iddp/iddp.c
index dc65f2e..ccc4ea4 100644
--- a/testsuite/smokey/iddp/iddp.c
+++ b/testsuite/smokey/iddp/iddp.c
@@ -83,8 +83,8 @@ static void *server(void *arg)
errno = -EINVAL;
fail(recvfrom);
}
-   smokey_note(%s: received %d bytes, %ld from port %d,
- __FUNCTION__, ret, data, claddr.sipc_port);
+   smokey_trace(%s: received %d bytes, %ld from port %d,
+__FUNCTION__, ret, data, claddr.sipc_port);
}
 
return NULL;
@@ -127,7 +127,7 @@ static void *client(void *arg)
close(s);
fail(sendto);
}
-   smokey_note(%s: sent %d bytes, %ld, __FUNCTION__, ret, data);
+   smokey_trace(%s: sent %d bytes, %ld, __FUNCTION__, ret, data);
ts.tv_sec = 0;
ts.tv_nsec = 1; /* 100 ms */
clock_nanosleep(CLOCK_REALTIME, 0, ts, NULL);
diff --git a/testsuite/smokey/posix-clock/posix-clock.c 
b/testsuite/smokey/posix-clock/posix-clock.c
index 9781565..f672a9d 100644
--- a/testsuite/smokey/posix-clock/posix-clock.c
+++ b/testsuite/smokey/posix-clock/posix-clock.c
@@ -42,7 +42,7 @@ static int 
clock_increase_before_oneshot_timer_first_tick(void)
struct timespec now;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);

t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
@@ -99,7 +99,7 @@ static int 
clock_increase_before_periodic_timer_first_tick(void)
struct timespec now;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);

t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
@@ -161,7 +161,7 @@ static int 
clock_increase_after_periodic_timer_first_tick(void)
struct timespec now;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);

t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
@@ -237,7 +237,7 @@ static int 
clock_decrease_before_oneshot_timer_first_tick(void)
long long diff;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);

t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
@@ -296,7 +296,7 @@ static int 
clock_decrease_before_periodic_timer_first_tick(void)
long long diff;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);

t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
@@ -362,7 +362,7 @@ static int 
clock_decrease_after_periodic_timer_first_tick(void)
long long diff;
int t, ret;
 
-   smokey_note(__func__);
+   smokey_trace(__func__);
 
t = smokey_check_errno(timerfd_create(CLOCK_REALTIME, 0));
if (t  0)
diff 

[Xenomai-git] Philippe Gerum : lib/smokey: add trace helper

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 14:43:02 2015 +0200

lib/smokey: add trace helper

---

 include/smokey/smokey.h |2 ++
 lib/smokey/helpers.c|   14 ++
 lib/smokey/init.c   |   15 ---
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index 0a7b5e9..cd3ca7e 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -146,6 +146,8 @@ struct smokey_arg *smokey_lookup_arg(struct smokey_test *t,
 int smokey_parse_args(struct smokey_test *t,
  int argc, char *const argv[]);
 
+void smokey_trace(const char *fmt, ...);
+
 void smokey_note(const char *fmt, ...);
 
 void smokey_warning(const char *file, int lineno,
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index cef86aa..bb4902a 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -132,6 +132,20 @@ void smokey_note(const char *fmt, ...)
va_end(ap);
 }
 
+void smokey_trace(const char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+
+   if (smokey_verbose_mode  1) {
+   __RT(vfprintf(stdout, fmt, ap));
+   __RT(fprintf(stdout, \n));
+   }
+
+   va_end(ap);
+}
+
 void smokey_warning(const char *file, int lineno,
const char *fmt, ...)
 {
diff --git a/lib/smokey/init.c b/lib/smokey/init.c
index 876fc0d..2c16cde 100644
--- a/lib/smokey/init.c
+++ b/lib/smokey/init.c
@@ -199,12 +199,21 @@
  * including the test detection and the active test selection have
  * been performed by the Smokey API already.
  *
- * @par Issuing progress messages
+ * @par Issuing information notices
  *
  * The printf-like @a smokey_note() routine is available for issuing
+ * notices to the output device (currently stdout), unless --silent
+ * was detected on the command line. smokey_note() outputs a
+ * terminating newline character. Notes are enabled for any verbosity
+ * level greater than zero.
+ *
+ * @par Issuing trace messages
+ *
+ * The printf-like @a smokey_trace() routine is available for issuing
  * progress messages to the output device (currently stdout), unless
- * --silent was detected on the command line. smokey_note() outputs
- * a terminating newline character.
+ * --silent was detected on the command line. smokey_trace() outputs a
+ * terminating newline character. Traces are enabled for any verbosity
+ * level greater than one.
  *
  * Therefore, a possible implementation of a test driver could be as
  * basic as:


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Jan Kiszka : cobalt/kernel: Fix mode of mayday syscall

2015-06-20 Thread git repository hosting
Module: xenomai-jki
Branch: for-forge
Commit: c806b60eaf505aafd4dbeeaf59cd3fc6d68703fa
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=c806b60eaf505aafd4dbeeaf59cd3fc6d68703fa

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Jun 19 15:59:15 2015 +0200

cobalt/kernel: Fix mode of mayday syscall

The oneway mode meant norestart, thus return -EINTR instead of retrying
the syscall after signal processing. But this caused damaged to the
register state of the mayday-interrupted thread, most visible on x86-64
where RAX is holding the RIP.

Fix this by restarting the syscall on signals. The syscall is supposed
to deliver the same result then, including a correct register state.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 kernel/cobalt/posix/syscall.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index cf93f07..7e2d434 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -71,8 +71,6 @@
 #define __xn_exec_nonrestartable (__xn_exec_primary|__xn_exec_norestart)
 /* Shorthand for domain probing syscall */
 #define __xn_exec_probing   (__xn_exec_conforming|__xn_exec_adaptive)
-/* Shorthand for oneway trap - does not return to call site. */
-#define __xn_exec_oneway__xn_exec_norestart
 
 typedef long (*cobalt_syshand)(unsigned long arg1, unsigned long arg2,
   unsigned long arg3, unsigned long arg4,
@@ -246,7 +244,7 @@ static COBALT_SYSCALL(serialdbg, current,
return 0;
 }
 
-static COBALT_SYSCALL(mayday, oneway, (void))
+static COBALT_SYSCALL(mayday, current, (void))
 {
struct pt_regs *regs = task_pt_regs(current);
struct xnthread *cur;
@@ -792,7 +790,7 @@ static const int cobalt_sysmodes[] = {
__COBALT_MODE(extend, lostage),
__COBALT_MODE(trace, current),
__COBALT_MODE(get_current, current),
-   __COBALT_MODE(mayday, oneway),
+   __COBALT_MODE(mayday, current),
__COBALT_MODE(backtrace, current),
__COBALT_MODE(serialdbg, current),
__COBALT_MODE(corectl, probing),


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : testsuite/smokey/arith: tame down verbosity at default level

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 22:07:19 2015 +0200

testsuite/smokey/arith: tame down verbosity at default level

Use --verbose=2 to see computation details as previously.

---

 testsuite/smokey/arith/arith.c |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/testsuite/smokey/arith/arith.c b/testsuite/smokey/arith/arith.c
index 26f56ca..c927d1d 100644
--- a/testsuite/smokey/arith/arith.c
+++ b/testsuite/smokey/arith/arith.c
@@ -33,13 +33,13 @@ static volatile long long arg = 0x3ffULL;
if (rejected  1) { \
avg = xnarch_llimd(avg, 1, 1 - rejected); \
avg = clockobj_tsc_to_ns(avg) - calib;  \
-   fprintf(stderr, %s: 0x%016llx: %lld.%03llu ns, \
-rejected %d/1\n, \
-   display, result, avg / 1,   \
-   ((avg = 0 ? avg : -avg) % 1) / 10, \
-   rejected);  \
+   smokey_trace(%s: 0x%016llx: %lld.%03llu ns,   \
+rejected %d/1,   \
+   display, result, avg / 1,   \
+   ((avg = 0 ? avg : -avg) % 1) / 10, \
+   rejected);  \
} else  \
-   fprintf(stderr, %s: rejected 1/1\n, display); 
\
+   smokey_warning(%s: rejected 1/1, display); \
} while (0)
 
 static int run_arith(struct smokey_test *t, int argc, char *const argv[])
@@ -53,13 +53,13 @@ static int run_arith(struct smokey_test *t, int argc, char 
*const argv[])
 
/* Prepare. */
xnarch_init_llmulshft(nsec_per_sec, sample_freq, mul, shft);
-   fprintf(stderr, mul: 0x%08x, shft: %d\n, mul, shft);
+   smokey_trace(mul: 0x%08x, shft: %d, mul, shft);
 #ifdef XNARCH_HAVE_NODIV_LLIMD
xnarch_init_u32frac(frac, nsec_per_sec, sample_freq);
-   fprintf(stderr, integ: %d, frac: 0x%08llx\n, frac.integ, frac.frac);
+   smokey_trace(integ: %d, frac: 0x%08llx, frac.integ, frac.frac);
 #endif /* XNARCH_HAVE_NODIV_LLIMD */
 
-   fprintf(stderr, \nsigned positive operation: 0x%016llx * %u / %d\n,
+   smokey_trace(\nsigned positive operation: 0x%016llx * %u / %d,
arg, nsec_per_sec, sample_freq);
bench(inline calibration, 0);
calib = avg;
@@ -82,8 +82,8 @@ static int run_arith(struct smokey_test *t, int argc, char 
*const argv[])
 #endif /* XNARCH_HAVE_NODIV_LLIMD */
 
 
-   fprintf(stderr, \nsigned negative operation: 0x%016llx * %u / %d\n,
-   -arg, nsec_per_sec, sample_freq);
+   smokey_trace(\nsigned negative operation: 0x%016llx * %u / %d,
+-arg, nsec_per_sec, sample_freq);
calib = 0;
bench(inline calibration, 0);
calib = avg;
@@ -106,8 +106,8 @@ static int run_arith(struct smokey_test *t, int argc, char 
*const argv[])
 #endif /* XNARCH_HAVE_NODIV_LLIMD */
 
 #ifdef XNARCH_HAVE_NODIV_LLIMD
-   fprintf(stderr, \nunsigned operation: 0x%016llx * %u / %d\n,
-   arg, nsec_per_sec, sample_freq);
+   smokey_trace(\nunsigned operation: 0x%016llx * %u / %d,
+arg, nsec_per_sec, sample_freq);
calib = 0;
bench(inline calibration, 0);
calib = avg;


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : testsuite/smokey: add leakage detection test

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

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 20 22:01:37 2015 +0200

testsuite/smokey: add leakage detection test

---

 configure.ac   |3 +-
 include/smokey/smokey.h|   19 +-
 lib/smokey/helpers.c   |4 +-
 testsuite/Makefile.am  |2 -
 testsuite/regression/Makefile.am   |1 -
 testsuite/regression/posix/Makefile.am |   18 --
 testsuite/regression/posix/check.h |   50 -
 testsuite/smokey/Makefile.am   |2 +
 testsuite/smokey/leaks/Makefile.am |   10 +
 .../{regression/posix = smokey/leaks}/leaks.c |  199 ++--
 10 files changed, 163 insertions(+), 145 deletions(-)

diff --git a/configure.ac b/configure.ac
index 43deedb..6f55a4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -937,10 +937,9 @@ AC_CONFIG_FILES([ \
testsuite/smokey/bufp/Makefile \
testsuite/smokey/sigdebug/Makefile \
testsuite/smokey/timerfd/Makefile \
+   testsuite/smokey/leaks/Makefile \
testsuite/clocktest/Makefile \
testsuite/xeno-test/Makefile \
-   testsuite/regression/Makefile \
-   testsuite/regression/posix/Makefile \
utils/Makefile \
utils/hdb/Makefile \
utils/can/Makefile \
diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index cd3ca7e..cd2840a 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -102,8 +102,8 @@ struct smokey_test {
int __ret = (__expr);   \
if (__ret  0) {\
__ret = -errno; \
-   smokey_warning(__FILE__, __LINE__, %s: %s,\
-  #__expr, strerror(errno));   \
+   __smokey_warning(__FILE__, __LINE__, %s: %s,  \
+#__expr, strerror(errno)); \
}   \
__ret;  \
})
@@ -112,8 +112,8 @@ struct smokey_test {
({  \
int __ret = (__expr);   \
if (__ret) {\
-   smokey_warning(__FILE__, __LINE__, %s: %s,\
-  #__expr, strerror(__ret));   \
+   __smokey_warning(__FILE__, __LINE__, %s: %s,  \
+#__expr, strerror(__ret)); \
__ret = -__ret; \
}   \
__ret;  \
@@ -123,11 +123,14 @@ struct smokey_test {
({  \
int __ret = (__expr);   \
if (!__ret) \
-   smokey_warning(__FILE__, __LINE__,  \
-  assertion failed: %s, #__expr); \
+   __smokey_warning(__FILE__, __LINE__,\
+assertion failed: %s, #__expr); \
__ret;  \
})
 
+#define smokey_warning(__fmt, __args...)   \
+   __smokey_warning(__FILE__, __LINE__, __fmt, #__args)
+
 #ifdef __cplusplus
 extern C {
 #endif
@@ -150,8 +153,8 @@ void smokey_trace(const char *fmt, ...);
 
 void smokey_note(const char *fmt, ...);
 
-void smokey_warning(const char *file, int lineno,
-   const char *fmt, ...);
+void __smokey_warning(const char *file, int lineno,
+ const char *fmt, ...);
 
 #ifdef __cplusplus
 }
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index bb4902a..60764b8 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -146,8 +146,8 @@ void smokey_trace(const char *fmt, ...)
va_end(ap);
 }
 
-void smokey_warning(const char *file, int lineno,
-   const char *fmt, ...)
+void __smokey_warning(const char *file, int lineno,
+ const char *fmt, ...)
 {
va_list ap;
 
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index b37db7b..e83e6cb 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -4,7 +4,6 @@ SUBDIRS = latency smokey
 if XENO_COBALT
 SUBDIRS +=