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

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

Author: Philippe Gerum 
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 
 #include 
 #include 
 #include 
 #include 
-
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
+#include 
 
-#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 *cookie)
 {
mqd_t mqd = (mqd_t)(long)cookie;
-   fd_set inset;
-   unsigned i;
+   unsigned int 

[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 
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 
 #include 
 #include 
 #include 
 #include 
-
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
+#include 
 
-#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 *cookie)
 {
mqd_t mqd = (mqd_t)(long)cookie;
-   fd_set inset;
-   unsigned i;
+   unsigned int i