Add multiflavor test program
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Nov 2012 21:50:24 +0000 (17:50 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Nov 2012 21:50:24 +0000 (17:50 -0400)
Add a multiflavor test program to catch symbol name clashes earlier next
time.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/Makefile.am
tests/runall.sh
tests/test_urcu_multiflavor-bp.c [new file with mode: 0644]
tests/test_urcu_multiflavor-mb.c [new file with mode: 0644]
tests/test_urcu_multiflavor-memb.c [new file with mode: 0644]
tests/test_urcu_multiflavor-qsbr.c [new file with mode: 0644]
tests/test_urcu_multiflavor-signal.c [new file with mode: 0644]
tests/test_urcu_multiflavor.c [new file with mode: 0644]

index df22d068b4ed484aec1bd59d5bba80a20e2b8e14..b0293779c18821cf05f02de4e66bc419c64913f4 100644 (file)
@@ -19,7 +19,8 @@ noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \
        test_urcu_wfq_dynlink test_urcu_wfs_dynlink \
        test_urcu_wfcq_dynlink \
        test_urcu_lfq_dynlink test_urcu_lfs_dynlink test_urcu_hash \
-       test_urcu_lfs_rcu_dynlink
+       test_urcu_lfs_rcu_dynlink \
+       test_urcu_multiflavor test_urcu_multiflavor_dynlink
 noinst_HEADERS = rcutorture.h
 
 if COMPAT_ARCH
@@ -206,6 +207,25 @@ test_urcu_hash_SOURCES = test_urcu_hash.c test_urcu_hash.h \
 test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS)
 test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_CDS_LIB)
 
+test_urcu_multiflavor_SOURCES = test_urcu_multiflavor.c \
+       test_urcu_multiflavor-memb.c \
+       test_urcu_multiflavor-mb.c \
+       test_urcu_multiflavor-signal.c \
+       test_urcu_multiflavor-qsbr.c \
+       test_urcu_multiflavor-bp.c
+test_urcu_multiflavor_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \
+       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB)
+
+test_urcu_multiflavor_dynlink_SOURCES = test_urcu_multiflavor.c \
+       test_urcu_multiflavor-memb.c \
+       test_urcu_multiflavor-mb.c \
+       test_urcu_multiflavor-signal.c \
+       test_urcu_multiflavor-qsbr.c \
+       test_urcu_multiflavor-bp.c
+test_urcu_multiflavor_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
+test_urcu_multiflavor_dynlink_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \
+       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB)
+
 urcutorture.c: api.h
 
 check-am:
index 6072acabe9233d9739020b83c572e519b61e7a2a..8d9d653eea7e7e245df171cdcee6380103ea2e76 100755 (executable)
@@ -100,5 +100,9 @@ for READERCSLEN in ${READERCSLEN_ARRAY}; do
        ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS} -c ${READERCSLEN} | tee -a readercslen.log
 done
 
+echo Executing multi-flavor RCU test
+./test_urcu_multiflavor
+./test_urcu_multiflavor_dynlink
+
 echo Executing Hash table test
 ./runhash.sh
diff --git a/tests/test_urcu_multiflavor-bp.c b/tests/test_urcu_multiflavor-bp.c
new file mode 100644 (file)
index 0000000..c9f00a3
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * test_urcu_multiflavor-bp.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DYNAMIC_LINK_TEST
+#define _LGPL_SOURCE
+#endif
+
+#define RCU_SIGNAL
+#include <urcu-bp.h>
+
+int test_mf_bp(void)
+{
+       rcu_register_thread();
+       rcu_read_lock();
+       rcu_read_unlock();
+       synchronize_rcu();
+       rcu_unregister_thread();
+       return 0;
+}
diff --git a/tests/test_urcu_multiflavor-mb.c b/tests/test_urcu_multiflavor-mb.c
new file mode 100644 (file)
index 0000000..5b5d7e4
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * test_urcu_multiflavor-mb.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DYNAMIC_LINK_TEST
+#define _LGPL_SOURCE
+#endif
+
+#define RCU_MB
+#include <urcu.h>
+
+int test_mf_mb(void)
+{
+       rcu_register_thread();
+       rcu_read_lock();
+       rcu_read_unlock();
+       synchronize_rcu();
+       rcu_unregister_thread();
+       return 0;
+}
diff --git a/tests/test_urcu_multiflavor-memb.c b/tests/test_urcu_multiflavor-memb.c
new file mode 100644 (file)
index 0000000..c3a0128
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * test_urcu_multiflavor-memb.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DYNAMIC_LINK_TEST
+#define _LGPL_SOURCE
+#endif
+
+#include <urcu.h>
+
+int test_mf_memb(void)
+{
+       rcu_register_thread();
+       rcu_read_lock();
+       rcu_read_unlock();
+       synchronize_rcu();
+       rcu_unregister_thread();
+       return 0;
+}
diff --git a/tests/test_urcu_multiflavor-qsbr.c b/tests/test_urcu_multiflavor-qsbr.c
new file mode 100644 (file)
index 0000000..f4fb145
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * test_urcu_multiflavor-qsbr.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DYNAMIC_LINK_TEST
+#define _LGPL_SOURCE
+#endif
+
+#include <urcu-qsbr.h>
+
+int test_mf_qsbr(void)
+{
+       rcu_register_thread();
+       rcu_read_lock();
+       rcu_read_unlock();
+       synchronize_rcu();
+       rcu_unregister_thread();
+       return 0;
+}
diff --git a/tests/test_urcu_multiflavor-signal.c b/tests/test_urcu_multiflavor-signal.c
new file mode 100644 (file)
index 0000000..5519d36
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * test_urcu_multiflavor-signal.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DYNAMIC_LINK_TEST
+#define _LGPL_SOURCE
+#endif
+
+#define RCU_SIGNAL
+#include <urcu.h>
+
+int test_mf_signal(void)
+{
+       rcu_register_thread();
+       rcu_read_lock();
+       rcu_read_unlock();
+       synchronize_rcu();
+       rcu_unregister_thread();
+       return 0;
+}
diff --git a/tests/test_urcu_multiflavor.c b/tests/test_urcu_multiflavor.c
new file mode 100644 (file)
index 0000000..825333e
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * test_urcu_multiflavor.c
+ *
+ * Userspace RCU library - test multiple RCU flavors into one program
+ *
+ * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+       int ret;
+
+       ret = test_mf_memb();
+       if (ret)
+               goto failure;
+       ret = test_mf_mb();
+       if (ret)
+               goto failure;
+       ret = test_mf_signal();
+       if (ret)
+               goto failure;
+       ret = test_mf_qsbr();
+       if (ret)
+               goto failure;
+       ret = test_mf_bp();
+       if (ret)
+               goto failure;
+
+       exit(EXIT_SUCCESS);
+
+failure:
+       exit(EXIT_FAILURE);
+}
This page took 0.029489 seconds and 4 git commands to generate.