From f5ab766ee2c8300cb00ca5878b1cb464f960a66d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 9 Aug 2013 18:13:23 -0400 Subject: [PATCH] tests: split in check, regtest and bench targets Allow make check to run without requiring build machines to use hours of CPU time. make check: short unit tests make regtest: long regression tests make bench: long benchmarks Fixes #611 Signed-off-by: Mathieu Desnoyers --- .gitignore | 140 +++++----- Makefile.am | 9 +- configure.ac | 4 + tests/Makefile.am | 239 +----------------- tests/benchmark/Makefile.am | 186 ++++++++++++++ tests/{ => benchmark}/common.sh | 0 tests/{ => benchmark}/runall.sh | 4 - tests/{ => benchmark}/runhash.sh | 0 tests/{ => benchmark}/runpaul-phase1.sh | 0 tests/{ => benchmark}/runpaul-phase2.sh | 0 tests/{ => benchmark}/runpaul-phase3.sh | 0 tests/{ => benchmark}/runpaul-phase4.sh | 0 tests/{ => benchmark}/runpaul-phase5.sh | 0 tests/{ => benchmark}/runpaul-phase6.sh | 0 tests/{ => benchmark}/runpaul-phase7.sh | 0 tests/{ => benchmark}/runtests-batch.sh | 0 tests/{ => benchmark}/runtests.sh | 0 tests/{ => benchmark}/subphase4.sh | 0 tests/{ => benchmark}/test_cycles_per_loop.c | 0 tests/{ => benchmark}/test_looplen.c | 0 tests/{ => benchmark}/test_mutex.c | 2 +- tests/{ => benchmark}/test_perthreadlock.c | 2 +- .../test_perthreadlock_timing.c | 0 tests/{ => benchmark}/test_rwlock.c | 2 +- tests/{ => benchmark}/test_rwlock_timing.c | 0 tests/{ => benchmark}/test_urcu.c | 2 +- tests/{ => benchmark}/test_urcu_assign.c | 2 +- tests/{ => benchmark}/test_urcu_bp.c | 2 +- tests/{ => benchmark}/test_urcu_defer.c | 2 +- tests/{ => benchmark}/test_urcu_gc.c | 2 +- tests/{ => benchmark}/test_urcu_hash.c | 0 tests/{ => benchmark}/test_urcu_hash.h | 2 +- tests/{ => benchmark}/test_urcu_hash_rw.c | 0 tests/{ => benchmark}/test_urcu_hash_unique.c | 0 tests/{ => benchmark}/test_urcu_lfq.c | 2 +- tests/{ => benchmark}/test_urcu_lfs.c | 2 +- tests/{ => benchmark}/test_urcu_lfs_rcu.c | 2 +- tests/{ => benchmark}/test_urcu_qsbr.c | 2 +- tests/{ => benchmark}/test_urcu_qsbr_gc.c | 2 +- tests/{ => benchmark}/test_urcu_qsbr_timing.c | 0 tests/{ => benchmark}/test_urcu_timing.c | 0 tests/{ => benchmark}/test_urcu_wfcq.c | 2 +- tests/{ => benchmark}/test_urcu_wfq.c | 2 +- tests/{ => benchmark}/test_urcu_wfs.c | 2 +- tests/{ => common}/api.h | 2 +- tests/{ => common}/cpuset.h | 2 +- tests/{ => common}/thread-id.h | 0 tests/regression/Makefile.am | 75 ++++++ tests/{ => regression}/rcutorture.h | 0 tests/{ => regression}/test_urcu_fork.c | 2 +- tests/{ => regression}/urcutorture.c | 0 tests/unit/Makefile.am | 61 +++++ tests/{ => unit}/test_uatomic.c | 0 tests/{ => unit}/test_urcu_multiflavor-bp.c | 0 tests/{ => unit}/test_urcu_multiflavor-mb.c | 0 tests/{ => unit}/test_urcu_multiflavor-memb.c | 0 tests/{ => unit}/test_urcu_multiflavor-qsbr.c | 0 .../{ => unit}/test_urcu_multiflavor-signal.c | 0 tests/{ => unit}/test_urcu_multiflavor.c | 0 tests/{ => unit}/test_urcu_multiflavor.h | 0 tests/{ => unit}/urcu-asm.c | 0 61 files changed, 430 insertions(+), 328 deletions(-) create mode 100644 tests/benchmark/Makefile.am rename tests/{ => benchmark}/common.sh (100%) rename tests/{ => benchmark}/runall.sh (96%) rename tests/{ => benchmark}/runhash.sh (100%) rename tests/{ => benchmark}/runpaul-phase1.sh (100%) rename tests/{ => benchmark}/runpaul-phase2.sh (100%) rename tests/{ => benchmark}/runpaul-phase3.sh (100%) rename tests/{ => benchmark}/runpaul-phase4.sh (100%) rename tests/{ => benchmark}/runpaul-phase5.sh (100%) rename tests/{ => benchmark}/runpaul-phase6.sh (100%) rename tests/{ => benchmark}/runpaul-phase7.sh (100%) rename tests/{ => benchmark}/runtests-batch.sh (100%) rename tests/{ => benchmark}/runtests.sh (100%) rename tests/{ => benchmark}/subphase4.sh (100%) rename tests/{ => benchmark}/test_cycles_per_loop.c (100%) rename tests/{ => benchmark}/test_looplen.c (100%) rename tests/{ => benchmark}/test_mutex.c (99%) rename tests/{ => benchmark}/test_perthreadlock.c (99%) rename tests/{ => benchmark}/test_perthreadlock_timing.c (100%) rename tests/{ => benchmark}/test_rwlock.c (99%) rename tests/{ => benchmark}/test_rwlock_timing.c (100%) rename tests/{ => benchmark}/test_urcu.c (99%) rename tests/{ => benchmark}/test_urcu_assign.c (99%) rename tests/{ => benchmark}/test_urcu_bp.c (99%) rename tests/{ => benchmark}/test_urcu_defer.c (99%) rename tests/{ => benchmark}/test_urcu_gc.c (99%) rename tests/{ => benchmark}/test_urcu_hash.c (100%) rename tests/{ => benchmark}/test_urcu_hash.h (99%) rename tests/{ => benchmark}/test_urcu_hash_rw.c (100%) rename tests/{ => benchmark}/test_urcu_hash_unique.c (100%) rename tests/{ => benchmark}/test_urcu_lfq.c (99%) rename tests/{ => benchmark}/test_urcu_lfs.c (99%) rename tests/{ => benchmark}/test_urcu_lfs_rcu.c (99%) rename tests/{ => benchmark}/test_urcu_qsbr.c (99%) rename tests/{ => benchmark}/test_urcu_qsbr_gc.c (99%) rename tests/{ => benchmark}/test_urcu_qsbr_timing.c (100%) rename tests/{ => benchmark}/test_urcu_timing.c (100%) rename tests/{ => benchmark}/test_urcu_wfcq.c (99%) rename tests/{ => benchmark}/test_urcu_wfq.c (99%) rename tests/{ => benchmark}/test_urcu_wfs.c (99%) rename tests/{ => common}/api.h (99%) rename tests/{ => common}/cpuset.h (98%) rename tests/{ => common}/thread-id.h (100%) create mode 100644 tests/regression/Makefile.am rename tests/{ => regression}/rcutorture.h (100%) rename tests/{ => regression}/test_urcu_fork.c (99%) rename tests/{ => regression}/urcutorture.c (100%) create mode 100644 tests/unit/Makefile.am rename tests/{ => unit}/test_uatomic.c (100%) rename tests/{ => unit}/test_urcu_multiflavor-bp.c (100%) rename tests/{ => unit}/test_urcu_multiflavor-mb.c (100%) rename tests/{ => unit}/test_urcu_multiflavor-memb.c (100%) rename tests/{ => unit}/test_urcu_multiflavor-qsbr.c (100%) rename tests/{ => unit}/test_urcu_multiflavor-signal.c (100%) rename tests/{ => unit}/test_urcu_multiflavor.c (100%) rename tests/{ => unit}/test_urcu_multiflavor.h (100%) rename tests/{ => unit}/urcu-asm.c (100%) diff --git a/.gitignore b/.gitignore index 00dbc40..7b6704b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,75 +2,77 @@ urcu/arch.h urcu/uatomic.h tests/api.h -tests/urcutorture -tests/urcutorture-yield -tests/urcu-asm.S -tests/test_rwlock_timing -tests/test_urcu -tests/test_urcu_dynamic_link -tests/test_urcu_timing -tests/test_urcu_yield -tests/test_looplen -tests/test_mutex -tests/test_perthreadlock -tests/test_perthreadlock_timing -tests/test_qsbr -tests/test_qsbr_dynamic_link -tests/test_qsbr_gc -tests/test_qsbr_lgc -tests/test_qsbr_timing -tests/test_rwlock -tests/test_uatomic -tests/test_urcu_gc -tests/test_urcu_gc_mb -tests/test_urcu_lgc -tests/test_urcu_lgc_mb -tests/test_urcu_mb -tests/test_urcu_mb_defer -tests/test_urcu_assign -tests/test_urcu_assign_dynamic_link -tests/test_urcu_bp -tests/test_urcu_bp_dynamic_link -tests/rcutorture_qsbr -tests/rcutorture_urcu -tests/rcutorture_urcu_bp -tests/rcutorture_urcu_mb -tests/rcutorture_urcu_qsbr -tests/rcutorture_urcu_signal -tests/test_cycles_per_loop -tests/test_urcu_defer -tests/test_urcu_hash -tests/test_urcu_lfq -tests/test_urcu_lfq_dynlink -tests/test_urcu_lfs -tests/test_urcu_lfs_dynlink -tests/test_urcu_mb_gc -tests/test_urcu_mb_lgc -tests/test_urcu_qsbr -tests/test_urcu_qsbr_dynamic_link -tests/test_urcu_qsbr_gc -tests/test_urcu_qsbr_lgc -tests/test_urcu_qsbr_timing -tests/test_urcu_signal -tests/test_urcu_signal_dynamic_link -tests/test_urcu_signal_gc -tests/test_urcu_signal_lgc -tests/test_urcu_signal_timing -tests/test_urcu_signal_yield -tests/test_urcu_wfq -tests/test_urcu_wfq_dynlink -tests/test_urcu_wfs -tests/test_urcu_wfs_dynlink -tests/test_urcu_fork -tests/test_urcu_ja -tests/test_urcu_ja_range -tests/test_urcu_lfs_rcu -tests/test_urcu_lfs_rcu_dynlink -tests/test_urcu_multiflavor -tests/test_urcu_multiflavor_dynlink -tests/test_urcu_wfcq -tests/test_urcu_wfcq_dynlink -tests/*.log + +tests/unit/urcu-asm.S +tests/unit/test_uatomic +tests/unit/test_urcu_multiflavor +tests/unit/test_urcu_multiflavor_dynlink + +tests/regression/rcutorture_qsbr +tests/regression/rcutorture_urcu +tests/regression/rcutorture_urcu_bp +tests/regression/rcutorture_urcu_mb +tests/regression/rcutorture_urcu_qsbr +tests/regression/rcutorture_urcu_signal +tests/regression/test_urcu_fork + +tests/benchmark/test_rwlock_timing +tests/benchmark/test_urcu +tests/benchmark/test_urcu_dynamic_link +tests/benchmark/test_urcu_timing +tests/benchmark/test_urcu_yield +tests/benchmark/test_looplen +tests/benchmark/test_mutex +tests/benchmark/test_perthreadlock +tests/benchmark/test_perthreadlock_timing +tests/benchmark/test_qsbr +tests/benchmark/test_qsbr_dynamic_link +tests/benchmark/test_qsbr_gc +tests/benchmark/test_qsbr_lgc +tests/benchmark/test_qsbr_timing +tests/benchmark/test_rwlock +tests/benchmark/test_urcu_gc +tests/benchmark/test_urcu_gc_mb +tests/benchmark/test_urcu_lgc +tests/benchmark/test_urcu_lgc_mb +tests/benchmark/test_urcu_mb +tests/benchmark/test_urcu_mb_defer +tests/benchmark/test_urcu_assign +tests/benchmark/test_urcu_assign_dynamic_link +tests/benchmark/test_urcu_bp +tests/benchmark/test_urcu_bp_dynamic_link +tests/benchmark/test_cycles_per_loop +tests/benchmark/test_urcu_defer +tests/benchmark/test_urcu_hash +tests/benchmark/test_urcu_lfq +tests/benchmark/test_urcu_lfq_dynlink +tests/benchmark/test_urcu_lfs +tests/benchmark/test_urcu_lfs_dynlink +tests/benchmark/test_urcu_mb_gc +tests/benchmark/test_urcu_mb_lgc +tests/benchmark/test_urcu_qsbr +tests/benchmark/test_urcu_qsbr_dynamic_link +tests/benchmark/test_urcu_qsbr_gc +tests/benchmark/test_urcu_qsbr_lgc +tests/benchmark/test_urcu_qsbr_timing +tests/benchmark/test_urcu_signal +tests/benchmark/test_urcu_signal_dynamic_link +tests/benchmark/test_urcu_signal_gc +tests/benchmark/test_urcu_signal_lgc +tests/benchmark/test_urcu_signal_timing +tests/benchmark/test_urcu_signal_yield +tests/benchmark/test_urcu_wfq +tests/benchmark/test_urcu_wfq_dynlink +tests/benchmark/test_urcu_wfs +tests/benchmark/test_urcu_wfs_dynlink +tests/benchmark/test_urcu_ja +tests/benchmark/test_urcu_ja_range +tests/benchmark/test_urcu_lfs_rcu +tests/benchmark/test_urcu_lfs_rcu_dynlink +tests/benchmark/test_urcu_wfcq +tests/benchmark/test_urcu_wfcq_dynlink + +tests/benchmark/*.log *.so doc/examples/urcu-flavors/qsbr diff --git a/Makefile.am b/Makefile.am index 0a4d357..e09778f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,8 +29,7 @@ EXTRA_DIST = $(top_srcdir)/urcu/arch/*.h $(top_srcdir)/urcu/uatomic/*.h \ gpl-2.0.txt lgpl-2.1.txt lgpl-relicensing.txt \ LICENSE compat_arch_x86.c \ urcu-call-rcu-impl.h urcu-defer-impl.h \ - rculfhash-internal.h \ - $(top_srcdir)/tests/*.sh + rculfhash-internal.h if COMPAT_ARCH COMPAT=compat_arch_@ARCHTYPE@.c @@ -84,3 +83,9 @@ pkgconfig_DATA = liburcu-cds.pc liburcu.pc liburcu-bp.pc liburcu-qsbr.pc \ dist_doc_DATA = README ChangeLog dist_noinst_DATA = CodingStyle + +.PHONY: bench regtest +bench: + cd tests && $(MAKE) $(AM_MAKEFLAGS) bench +regtest: + cd tests && $(MAKE) $(AM_MAKEFLAGS) regtest diff --git a/configure.ac b/configure.ac index 52b20d8..fc1240d 100644 --- a/configure.ac +++ b/configure.ac @@ -293,6 +293,10 @@ AC_CONFIG_FILES([ doc/Makefile doc/examples/Makefile tests/Makefile + tests/common/Makefile + tests/unit/Makefile + tests/benchmark/Makefile + tests/regression/Makefile liburcu.pc liburcu-bp.pc liburcu-cds.pc diff --git a/tests/Makefile.am b/tests/Makefile.am index aa36bf4..d8fc5ef 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,235 +1,8 @@ -AM_LDFLAGS=-lpthread -AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -g +SUBDIRS = common unit benchmark regression -noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \ - test_urcu_signal test_urcu_signal_dynamic_link test_urcu_signal_timing \ - test_rwlock_timing test_rwlock test_perthreadlock_timing \ - test_perthreadlock test_urcu_yield test_urcu_signal_yield test_urcu_mb \ - test_urcu_qsbr_timing test_urcu_qsbr rcutorture_urcu rcutorture_urcu_signal \ - rcutorture_urcu_mb rcutorture_urcu_bp rcutorture_urcu_qsbr \ - test_mutex test_looplen test_urcu_gc test_urcu_signal_gc \ - test_urcu_lgc \ - test_urcu_mb_gc test_urcu_qsbr_gc test_urcu_qsbr_lgc test_urcu_signal_lgc \ - test_urcu_mb_lgc test_urcu_qsbr_dynamic_link test_urcu_defer \ - test_uatomic test_urcu_assign test_urcu_assign_dynamic_link \ - test_urcu_bp test_urcu_bp_dynamic_link test_cycles_per_loop \ - test_urcu_lfq test_urcu_wfq test_urcu_lfs test_urcu_wfs \ - test_urcu_lfs_rcu \ - test_urcu_wfcq \ - 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_multiflavor test_urcu_multiflavor_dynlink \ - test_urcu_fork -noinst_HEADERS = rcutorture.h test_urcu_multiflavor.h cpuset.h thread-id.h +.PHONY: bench regtest -if COMPAT_ARCH -COMPAT=$(top_srcdir)/compat_arch_@ARCHTYPE@.c -else -COMPAT= -endif - -if COMPAT_FUTEX -COMPAT+=$(top_srcdir)/compat_futex.c -endif - -URCU=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) -URCU_QSBR=$(top_srcdir)/urcu-qsbr.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) -# URCU_MB uses urcu.c but -DRCU_MB must be defined -URCU_MB=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) -# URCU_SIGNAL uses urcu.c but -DRCU_SIGNAL must be defined -URCU_SIGNAL=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) -URCU_BP=$(top_srcdir)/urcu-bp.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) -URCU_DEFER=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) - -URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la -URCU_LIB=$(top_builddir)/liburcu.la -URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la -URCU_MB_LIB=$(top_builddir)/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la -URCU_BP_LIB=$(top_builddir)/liburcu-bp.la -URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la - -EXTRA_DIST = $(top_srcdir)/tests/api.h runall.sh runhash.sh - -test_urcu_SOURCES = test_urcu.c $(URCU) - -test_urcu_dynamic_link_SOURCES = test_urcu.c $(URCU) -test_urcu_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) - -test_urcu_timing_SOURCES = test_urcu_timing.c $(URCU) - -test_urcu_yield_SOURCES = test_urcu.c $(URCU) -test_urcu_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS) - - -test_urcu_qsbr_SOURCES = test_urcu_qsbr.c $(URCU_QSBR) - -test_urcu_qsbr_timing_SOURCES = test_urcu_qsbr_timing.c $(URCU_QSBR) - - -test_urcu_mb_SOURCES = test_urcu.c $(URCU_MB) -test_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS) - - -test_urcu_signal_SOURCES = test_urcu.c $(URCU_SIGNAL) -test_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) - -test_urcu_signal_dynamic_link_SOURCES = test_urcu.c $(URCU_SIGNAL) -test_urcu_signal_dynamic_link_CFLAGS = -DRCU_SIGNAL -DDYNAMIC_LINK_TEST \ - $(AM_CFLAGS) - -test_urcu_signal_timing_SOURCES = test_urcu_timing.c $(URCU_SIGNAL) -test_urcu_signal_timing_CFLAGS= -DRCU_SIGNAL $(AM_CFLAGS) - -test_urcu_signal_yield_SOURCES = test_urcu.c $(URCU_SIGNAL) -test_urcu_signal_yield_CFLAGS = -DRCU_SIGNAL -DDEBUG_YIELD $(AM_CFLAGS) - -test_urcu_fork_SOURCES = test_urcu_fork.c $(URCU) - -test_rwlock_timing_SOURCES = test_rwlock_timing.c $(URCU_SIGNAL) - -test_rwlock_SOURCES = test_rwlock.c $(URCU_SIGNAL) - -test_perthreadlock_timing_SOURCES = test_perthreadlock_timing.c $(URCU_SIGNAL) - -test_perthreadlock_SOURCES = test_perthreadlock.c $(URCU_SIGNAL) - - -rcutorture_urcu_SOURCES = urcutorture.c -rcutorture_urcu_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS) -rcutorture_urcu_LDADD = $(URCU) - -rcutorture_urcu_mb_SOURCES = urcutorture.c -rcutorture_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS) -rcutorture_urcu_mb_LDADD = $(URCU_MB_LIB) - -rcutorture_urcu_qsbr_SOURCES = urcutorture.c -rcutorture_urcu_qsbr_CFLAGS = -DTORTURE_QSBR -DRCU_QSBR $(AM_CFLAGS) -rcutorture_urcu_qsbr_LDADD = $(URCU_QSBR_LIB) - -rcutorture_urcu_signal_SOURCES = urcutorture.c -rcutorture_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) -rcutorture_urcu_signal_LDADD = $(URCU_SIGNAL_LIB) - -rcutorture_urcu_bp_SOURCES = urcutorture.c -rcutorture_urcu_bp_CFLAGS = -DRCU_BP $(AM_CFLAGS) -rcutorture_urcu_bp_LDADD = $(URCU_BP_LIB) - -test_mutex_SOURCES = test_mutex.c $(URCU) - -test_looplen_SOURCES = test_looplen.c - -test_urcu_gc_SOURCES = test_urcu_gc.c $(URCU) - -test_urcu_signal_gc_SOURCES = test_urcu_gc.c $(URCU_SIGNAL) -test_urcu_signal_gc_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) - -test_urcu_mb_gc_SOURCES = test_urcu_gc.c $(URCU_MB) -test_urcu_mb_gc_CFLAGS = -DRCU_MB $(AM_CFLAGS) - -test_urcu_qsbr_gc_SOURCES = test_urcu_qsbr_gc.c $(URCU_QSBR) - -test_urcu_qsbr_lgc_SOURCES = test_urcu_qsbr_gc.c $(URCU_QSBR) -test_urcu_qsbr_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) - -test_urcu_lgc_SOURCES = test_urcu_gc.c $(URCU) -test_urcu_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) - -test_urcu_signal_lgc_SOURCES = test_urcu_gc.c $(URCU_SIGNAL) -test_urcu_signal_lgc_CFLAGS = -DRCU_SIGNAL -DTEST_LOCAL_GC $(AM_CFLAGS) - -test_urcu_mb_lgc_SOURCES = test_urcu_gc.c $(URCU_MB) -test_urcu_mb_lgc_CFLAGS = -DTEST_LOCAL_GC -DRCU_MB $(AM_CFLAGS) - -test_urcu_qsbr_dynamic_link_SOURCES = test_urcu_qsbr.c $(URCU_QSBR) -test_urcu_qsbr_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) - -test_urcu_defer_SOURCES = test_urcu_defer.c $(URCU_DEFER) - -test_uatomic_SOURCES = test_uatomic.c $(COMPAT) - -test_cycles_per_loop_SOURCES = test_cycles_per_loop.c - -test_urcu_assign_SOURCES = test_urcu_assign.c $(URCU) - -test_urcu_assign_dynamic_link_SOURCES = test_urcu_assign.c $(URCU) -test_urcu_assign_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) - -test_urcu_bp_SOURCES = test_urcu_bp.c $(URCU_BP) - -test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c $(URCU_BP) -test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) - -test_urcu_lfq_SOURCES = test_urcu_lfq.c $(URCU) -test_urcu_lfq_LDADD = $(URCU_CDS_LIB) - -test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c $(URCU) -test_urcu_lfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_lfq_dynlink_LDADD = $(URCU_CDS_LIB) - -test_urcu_wfq_SOURCES = test_urcu_wfq.c $(COMPAT) -test_urcu_wfq_LDADD = $(URCU_COMMON_LIB) - -test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c -test_urcu_wfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_wfq_dynlink_LDADD = $(URCU_COMMON_LIB) - -test_urcu_wfcq_SOURCES = test_urcu_wfcq.c $(COMPAT) -test_urcu_wfcq_LDADD = $(URCU_COMMON_LIB) - -test_urcu_wfcq_dynlink_SOURCES = test_urcu_wfcq.c -test_urcu_wfcq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_wfcq_dynlink_LDADD = $(URCU_COMMON_LIB) - -test_urcu_lfs_SOURCES = test_urcu_lfs.c $(URCU) -test_urcu_lfs_LDADD = $(URCU_CDS_LIB) - -test_urcu_lfs_rcu_SOURCES = test_urcu_lfs_rcu.c $(URCU) -test_urcu_lfs_rcu_LDADD = $(URCU_CDS_LIB) - -test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c $(URCU) -test_urcu_lfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_lfs_dynlink_LDADD = $(URCU_CDS_LIB) - -test_urcu_lfs_rcu_dynlink_SOURCES = test_urcu_lfs_rcu.c $(URCU) -test_urcu_lfs_rcu_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_lfs_rcu_dynlink_LDADD = $(URCU_CDS_LIB) - -test_urcu_wfs_SOURCES = test_urcu_wfs.c $(COMPAT) -test_urcu_wfs_LDADD = $(URCU_COMMON_LIB) - -test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c -test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_wfs_dynlink_LDADD = $(URCU_COMMON_LIB) - -test_urcu_hash_SOURCES = test_urcu_hash.c test_urcu_hash.h \ - test_urcu_hash_rw.c test_urcu_hash_unique.c $(COMPAT) -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: - ./test_uatomic - ./runall.sh +bench: + cd benchmark && $(MAKE) $(AM_MAKEFLAGS) bench +regtest: + cd regression && $(MAKE) $(AM_MAKEFLAGS) regtest diff --git a/tests/benchmark/Makefile.am b/tests/benchmark/Makefile.am new file mode 100644 index 0000000..e071034 --- /dev/null +++ b/tests/benchmark/Makefile.am @@ -0,0 +1,186 @@ +AM_LDFLAGS=-lpthread +AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g + +noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \ + test_urcu_signal test_urcu_signal_dynamic_link test_urcu_signal_timing \ + test_rwlock_timing test_rwlock test_perthreadlock_timing \ + test_perthreadlock test_urcu_yield test_urcu_signal_yield test_urcu_mb \ + test_urcu_qsbr_timing test_urcu_qsbr \ + test_mutex test_looplen test_urcu_gc test_urcu_signal_gc \ + test_urcu_lgc \ + test_urcu_mb_gc test_urcu_qsbr_gc test_urcu_qsbr_lgc test_urcu_signal_lgc \ + test_urcu_mb_lgc test_urcu_qsbr_dynamic_link test_urcu_defer \ + test_urcu_assign test_urcu_assign_dynamic_link \ + test_urcu_bp test_urcu_bp_dynamic_link test_cycles_per_loop \ + test_urcu_lfq test_urcu_wfq test_urcu_lfs test_urcu_wfs \ + test_urcu_lfs_rcu \ + test_urcu_wfcq \ + 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 + +if COMPAT_ARCH +COMPAT=$(top_srcdir)/compat_arch_@ARCHTYPE@.c +else +COMPAT= +endif + +if COMPAT_FUTEX +COMPAT+=$(top_srcdir)/compat_futex.c +endif + +URCU=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_QSBR=$(top_srcdir)/urcu-qsbr.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_MB uses urcu.c but -DRCU_MB must be defined +URCU_MB=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_SIGNAL uses urcu.c but -DRCU_SIGNAL must be defined +URCU_SIGNAL=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_BP=$(top_srcdir)/urcu-bp.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_DEFER=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) + +URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la +URCU_LIB=$(top_builddir)/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la + +EXTRA_DIST = *.sh + +test_urcu_SOURCES = test_urcu.c $(URCU) + +test_urcu_dynamic_link_SOURCES = test_urcu.c $(URCU) +test_urcu_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) + +test_urcu_timing_SOURCES = test_urcu_timing.c $(URCU) + +test_urcu_yield_SOURCES = test_urcu.c $(URCU) +test_urcu_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS) + + +test_urcu_qsbr_SOURCES = test_urcu_qsbr.c $(URCU_QSBR) + +test_urcu_qsbr_timing_SOURCES = test_urcu_qsbr_timing.c $(URCU_QSBR) + + +test_urcu_mb_SOURCES = test_urcu.c $(URCU_MB) +test_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS) + + +test_urcu_signal_SOURCES = test_urcu.c $(URCU_SIGNAL) +test_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) + +test_urcu_signal_dynamic_link_SOURCES = test_urcu.c $(URCU_SIGNAL) +test_urcu_signal_dynamic_link_CFLAGS = -DRCU_SIGNAL -DDYNAMIC_LINK_TEST \ + $(AM_CFLAGS) + +test_urcu_signal_timing_SOURCES = test_urcu_timing.c $(URCU_SIGNAL) +test_urcu_signal_timing_CFLAGS= -DRCU_SIGNAL $(AM_CFLAGS) + +test_urcu_signal_yield_SOURCES = test_urcu.c $(URCU_SIGNAL) +test_urcu_signal_yield_CFLAGS = -DRCU_SIGNAL -DDEBUG_YIELD $(AM_CFLAGS) + +test_rwlock_timing_SOURCES = test_rwlock_timing.c $(URCU_SIGNAL) + +test_rwlock_SOURCES = test_rwlock.c $(URCU_SIGNAL) + +test_perthreadlock_timing_SOURCES = test_perthreadlock_timing.c $(URCU_SIGNAL) + +test_perthreadlock_SOURCES = test_perthreadlock.c $(URCU_SIGNAL) + +test_mutex_SOURCES = test_mutex.c $(URCU) + +test_looplen_SOURCES = test_looplen.c + +test_urcu_gc_SOURCES = test_urcu_gc.c $(URCU) + +test_urcu_signal_gc_SOURCES = test_urcu_gc.c $(URCU_SIGNAL) +test_urcu_signal_gc_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) + +test_urcu_mb_gc_SOURCES = test_urcu_gc.c $(URCU_MB) +test_urcu_mb_gc_CFLAGS = -DRCU_MB $(AM_CFLAGS) + +test_urcu_qsbr_gc_SOURCES = test_urcu_qsbr_gc.c $(URCU_QSBR) + +test_urcu_qsbr_lgc_SOURCES = test_urcu_qsbr_gc.c $(URCU_QSBR) +test_urcu_qsbr_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) + +test_urcu_lgc_SOURCES = test_urcu_gc.c $(URCU) +test_urcu_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) + +test_urcu_signal_lgc_SOURCES = test_urcu_gc.c $(URCU_SIGNAL) +test_urcu_signal_lgc_CFLAGS = -DRCU_SIGNAL -DTEST_LOCAL_GC $(AM_CFLAGS) + +test_urcu_mb_lgc_SOURCES = test_urcu_gc.c $(URCU_MB) +test_urcu_mb_lgc_CFLAGS = -DTEST_LOCAL_GC -DRCU_MB $(AM_CFLAGS) + +test_urcu_qsbr_dynamic_link_SOURCES = test_urcu_qsbr.c $(URCU_QSBR) +test_urcu_qsbr_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) + +test_urcu_defer_SOURCES = test_urcu_defer.c $(URCU_DEFER) + +test_cycles_per_loop_SOURCES = test_cycles_per_loop.c + +test_urcu_assign_SOURCES = test_urcu_assign.c $(URCU) + +test_urcu_assign_dynamic_link_SOURCES = test_urcu_assign.c $(URCU) +test_urcu_assign_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) + +test_urcu_bp_SOURCES = test_urcu_bp.c $(URCU_BP) + +test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c $(URCU_BP) +test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) + +test_urcu_lfq_SOURCES = test_urcu_lfq.c $(URCU) +test_urcu_lfq_LDADD = $(URCU_CDS_LIB) + +test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c $(URCU) +test_urcu_lfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_lfq_dynlink_LDADD = $(URCU_CDS_LIB) + +test_urcu_wfq_SOURCES = test_urcu_wfq.c $(COMPAT) +test_urcu_wfq_LDADD = $(URCU_COMMON_LIB) + +test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c +test_urcu_wfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_wfq_dynlink_LDADD = $(URCU_COMMON_LIB) + +test_urcu_wfcq_SOURCES = test_urcu_wfcq.c $(COMPAT) +test_urcu_wfcq_LDADD = $(URCU_COMMON_LIB) + +test_urcu_wfcq_dynlink_SOURCES = test_urcu_wfcq.c +test_urcu_wfcq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_wfcq_dynlink_LDADD = $(URCU_COMMON_LIB) + +test_urcu_lfs_SOURCES = test_urcu_lfs.c $(URCU) +test_urcu_lfs_LDADD = $(URCU_CDS_LIB) + +test_urcu_lfs_rcu_SOURCES = test_urcu_lfs_rcu.c $(URCU) +test_urcu_lfs_rcu_LDADD = $(URCU_CDS_LIB) + +test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c $(URCU) +test_urcu_lfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_lfs_dynlink_LDADD = $(URCU_CDS_LIB) + +test_urcu_lfs_rcu_dynlink_SOURCES = test_urcu_lfs_rcu.c $(URCU) +test_urcu_lfs_rcu_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_lfs_rcu_dynlink_LDADD = $(URCU_CDS_LIB) + +test_urcu_wfs_SOURCES = test_urcu_wfs.c $(COMPAT) +test_urcu_wfs_LDADD = $(URCU_COMMON_LIB) + +test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c +test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) +test_urcu_wfs_dynlink_LDADD = $(URCU_COMMON_LIB) + +test_urcu_hash_SOURCES = test_urcu_hash.c test_urcu_hash.h \ + test_urcu_hash_rw.c test_urcu_hash_unique.c $(COMPAT) +test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS) +test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_CDS_LIB) + +.PHONY: bench + +bench: + ./runall.sh diff --git a/tests/common.sh b/tests/benchmark/common.sh similarity index 100% rename from tests/common.sh rename to tests/benchmark/common.sh diff --git a/tests/runall.sh b/tests/benchmark/runall.sh similarity index 96% rename from tests/runall.sh rename to tests/benchmark/runall.sh index 244766b..ced1765 100755 --- a/tests/runall.sh +++ b/tests/benchmark/runall.sh @@ -100,9 +100,5 @@ for READERCSLEN in ${READERCSLEN_ARRAY}; do (./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS} -c ${READERCSLEN} | tee -a readercslen.log) || exit 1 done -echo Executing multi-flavor RCU test -./test_urcu_multiflavor || exit 1 -./test_urcu_multiflavor_dynlink || exit 1 - echo Executing Hash table test ./runhash.sh || exit 1 diff --git a/tests/runhash.sh b/tests/benchmark/runhash.sh similarity index 100% rename from tests/runhash.sh rename to tests/benchmark/runhash.sh diff --git a/tests/runpaul-phase1.sh b/tests/benchmark/runpaul-phase1.sh similarity index 100% rename from tests/runpaul-phase1.sh rename to tests/benchmark/runpaul-phase1.sh diff --git a/tests/runpaul-phase2.sh b/tests/benchmark/runpaul-phase2.sh similarity index 100% rename from tests/runpaul-phase2.sh rename to tests/benchmark/runpaul-phase2.sh diff --git a/tests/runpaul-phase3.sh b/tests/benchmark/runpaul-phase3.sh similarity index 100% rename from tests/runpaul-phase3.sh rename to tests/benchmark/runpaul-phase3.sh diff --git a/tests/runpaul-phase4.sh b/tests/benchmark/runpaul-phase4.sh similarity index 100% rename from tests/runpaul-phase4.sh rename to tests/benchmark/runpaul-phase4.sh diff --git a/tests/runpaul-phase5.sh b/tests/benchmark/runpaul-phase5.sh similarity index 100% rename from tests/runpaul-phase5.sh rename to tests/benchmark/runpaul-phase5.sh diff --git a/tests/runpaul-phase6.sh b/tests/benchmark/runpaul-phase6.sh similarity index 100% rename from tests/runpaul-phase6.sh rename to tests/benchmark/runpaul-phase6.sh diff --git a/tests/runpaul-phase7.sh b/tests/benchmark/runpaul-phase7.sh similarity index 100% rename from tests/runpaul-phase7.sh rename to tests/benchmark/runpaul-phase7.sh diff --git a/tests/runtests-batch.sh b/tests/benchmark/runtests-batch.sh similarity index 100% rename from tests/runtests-batch.sh rename to tests/benchmark/runtests-batch.sh diff --git a/tests/runtests.sh b/tests/benchmark/runtests.sh similarity index 100% rename from tests/runtests.sh rename to tests/benchmark/runtests.sh diff --git a/tests/subphase4.sh b/tests/benchmark/subphase4.sh similarity index 100% rename from tests/subphase4.sh rename to tests/benchmark/subphase4.sh diff --git a/tests/test_cycles_per_loop.c b/tests/benchmark/test_cycles_per_loop.c similarity index 100% rename from tests/test_cycles_per_loop.c rename to tests/benchmark/test_cycles_per_loop.c diff --git a/tests/test_looplen.c b/tests/benchmark/test_looplen.c similarity index 100% rename from tests/test_looplen.c rename to tests/benchmark/test_looplen.c diff --git a/tests/test_mutex.c b/tests/benchmark/test_mutex.c similarity index 99% rename from tests/test_mutex.c rename to tests/benchmark/test_mutex.c index 2f25454..255acfc 100644 --- a/tests/test_mutex.c +++ b/tests/benchmark/test_mutex.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c similarity index 99% rename from tests/test_perthreadlock.c rename to tests/benchmark/test_perthreadlock.c index 39e2feb..01c4fb0 100644 --- a/tests/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_perthreadlock_timing.c b/tests/benchmark/test_perthreadlock_timing.c similarity index 100% rename from tests/test_perthreadlock_timing.c rename to tests/benchmark/test_perthreadlock_timing.c diff --git a/tests/test_rwlock.c b/tests/benchmark/test_rwlock.c similarity index 99% rename from tests/test_rwlock.c rename to tests/benchmark/test_rwlock.c index 5a0e8c1..32e3c39 100644 --- a/tests/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_rwlock_timing.c b/tests/benchmark/test_rwlock_timing.c similarity index 100% rename from tests/test_rwlock_timing.c rename to tests/benchmark/test_rwlock_timing.c diff --git a/tests/test_urcu.c b/tests/benchmark/test_urcu.c similarity index 99% rename from tests/test_urcu.c rename to tests/benchmark/test_urcu.c index 2764878..e87e235 100644 --- a/tests/test_urcu.c +++ b/tests/benchmark/test_urcu.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_assign.c b/tests/benchmark/test_urcu_assign.c similarity index 99% rename from tests/test_urcu_assign.c rename to tests/benchmark/test_urcu_assign.c index dc6bf2f..6c4adc3 100644 --- a/tests/test_urcu_assign.c +++ b/tests/benchmark/test_urcu_assign.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_bp.c b/tests/benchmark/test_urcu_bp.c similarity index 99% rename from tests/test_urcu_bp.c rename to tests/benchmark/test_urcu_bp.c index 9ec5f3e..0f21da9 100644 --- a/tests/test_urcu_bp.c +++ b/tests/benchmark/test_urcu_bp.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_defer.c b/tests/benchmark/test_urcu_defer.c similarity index 99% rename from tests/test_urcu_defer.c rename to tests/benchmark/test_urcu_defer.c index 4e785c4..80249bd 100644 --- a/tests/test_urcu_defer.c +++ b/tests/benchmark/test_urcu_defer.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_gc.c b/tests/benchmark/test_urcu_gc.c similarity index 99% rename from tests/test_urcu_gc.c rename to tests/benchmark/test_urcu_gc.c index 5c57f3f..1375a5e 100644 --- a/tests/test_urcu_gc.c +++ b/tests/benchmark/test_urcu_gc.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_hash.c b/tests/benchmark/test_urcu_hash.c similarity index 100% rename from tests/test_urcu_hash.c rename to tests/benchmark/test_urcu_hash.c diff --git a/tests/test_urcu_hash.h b/tests/benchmark/test_urcu_hash.h similarity index 99% rename from tests/test_urcu_hash.h rename to tests/benchmark/test_urcu_hash.h index cd064e6..c0727b7 100644 --- a/tests/test_urcu_hash.h +++ b/tests/benchmark/test_urcu_hash.h @@ -23,7 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_hash_rw.c b/tests/benchmark/test_urcu_hash_rw.c similarity index 100% rename from tests/test_urcu_hash_rw.c rename to tests/benchmark/test_urcu_hash_rw.c diff --git a/tests/test_urcu_hash_unique.c b/tests/benchmark/test_urcu_hash_unique.c similarity index 100% rename from tests/test_urcu_hash_unique.c rename to tests/benchmark/test_urcu_hash_unique.c diff --git a/tests/test_urcu_lfq.c b/tests/benchmark/test_urcu_lfq.c similarity index 99% rename from tests/test_urcu_lfq.c rename to tests/benchmark/test_urcu_lfq.c index 5717f23..33d1e73 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/benchmark/test_urcu_lfq.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_lfs.c b/tests/benchmark/test_urcu_lfs.c similarity index 99% rename from tests/test_urcu_lfs.c rename to tests/benchmark/test_urcu_lfs.c index 5659d9a..33ba069 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/benchmark/test_urcu_lfs.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_lfs_rcu.c b/tests/benchmark/test_urcu_lfs_rcu.c similarity index 99% rename from tests/test_urcu_lfs_rcu.c rename to tests/benchmark/test_urcu_lfs_rcu.c index b76bde1..dc07485 100644 --- a/tests/test_urcu_lfs_rcu.c +++ b/tests/benchmark/test_urcu_lfs_rcu.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_qsbr.c b/tests/benchmark/test_urcu_qsbr.c similarity index 99% rename from tests/test_urcu_qsbr.c rename to tests/benchmark/test_urcu_qsbr.c index 85d8430..e8ba5f6 100644 --- a/tests/test_urcu_qsbr.c +++ b/tests/benchmark/test_urcu_qsbr.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_qsbr_gc.c b/tests/benchmark/test_urcu_qsbr_gc.c similarity index 99% rename from tests/test_urcu_qsbr_gc.c rename to tests/benchmark/test_urcu_qsbr_gc.c index e0a2004..5fc15c0 100644 --- a/tests/test_urcu_qsbr_gc.c +++ b/tests/benchmark/test_urcu_qsbr_gc.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_qsbr_timing.c b/tests/benchmark/test_urcu_qsbr_timing.c similarity index 100% rename from tests/test_urcu_qsbr_timing.c rename to tests/benchmark/test_urcu_qsbr_timing.c diff --git a/tests/test_urcu_timing.c b/tests/benchmark/test_urcu_timing.c similarity index 100% rename from tests/test_urcu_timing.c rename to tests/benchmark/test_urcu_timing.c diff --git a/tests/test_urcu_wfcq.c b/tests/benchmark/test_urcu_wfcq.c similarity index 99% rename from tests/test_urcu_wfcq.c rename to tests/benchmark/test_urcu_wfcq.c index f04c9bd..d0814cd 100644 --- a/tests/test_urcu_wfcq.c +++ b/tests/benchmark/test_urcu_wfcq.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_wfq.c b/tests/benchmark/test_urcu_wfq.c similarity index 99% rename from tests/test_urcu_wfq.c rename to tests/benchmark/test_urcu_wfq.c index 382a1f6..07ab72b 100644 --- a/tests/test_urcu_wfq.c +++ b/tests/benchmark/test_urcu_wfq.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/test_urcu_wfs.c b/tests/benchmark/test_urcu_wfs.c similarity index 99% rename from tests/test_urcu_wfs.c rename to tests/benchmark/test_urcu_wfs.c index 0fe7d4c..c74f8b7 100644 --- a/tests/test_urcu_wfs.c +++ b/tests/benchmark/test_urcu_wfs.c @@ -22,7 +22,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/api.h b/tests/common/api.h similarity index 99% rename from tests/api.h rename to tests/common/api.h index dced0d8..1403359 100644 --- a/tests/api.h +++ b/tests/common/api.h @@ -2,7 +2,7 @@ #define _INCLUDE_API_H #define _GNU_SOURCE -#include "../config.h" +#include "config.h" /* * common.h: Common Linux kernel-isms. diff --git a/tests/cpuset.h b/tests/common/cpuset.h similarity index 98% rename from tests/cpuset.h rename to tests/common/cpuset.h index 3f1587d..4d1f211 100644 --- a/tests/cpuset.h +++ b/tests/common/cpuset.h @@ -23,7 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../config.h" +#include "config.h" #if defined(HAVE_SCHED_SETAFFINITY) || defined(HAVE_CPU_SET_T) \ || defined(HAVE_CPU_ZERO) || defined(HAVE_CPU_SET) diff --git a/tests/thread-id.h b/tests/common/thread-id.h similarity index 100% rename from tests/thread-id.h rename to tests/common/thread-id.h diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am new file mode 100644 index 0000000..2c0542f --- /dev/null +++ b/tests/regression/Makefile.am @@ -0,0 +1,75 @@ +AM_LDFLAGS=-lpthread +AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g + +noinst_PROGRAMS = test_urcu_fork \ + rcutorture_urcu \ + rcutorture_urcu_signal \ + rcutorture_urcu_mb \ + rcutorture_urcu_bp \ + rcutorture_urcu_qsbr + +noinst_HEADERS = rcutorture.h + +if COMPAT_ARCH +COMPAT=$(top_srcdir)/compat_arch_@ARCHTYPE@.c +else +COMPAT= +endif + +if COMPAT_FUTEX +COMPAT+=$(top_srcdir)/compat_futex.c +endif + +URCU=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_QSBR=$(top_srcdir)/urcu-qsbr.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_MB uses urcu.c but -DRCU_MB must be defined +URCU_MB=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_SIGNAL uses urcu.c but -DRCU_SIGNAL must be defined +URCU_SIGNAL=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_BP=$(top_srcdir)/urcu-bp.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_DEFER=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) + +URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la +URCU_LIB=$(top_builddir)/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la + +test_urcu_fork_SOURCES = test_urcu_fork.c $(URCU) + +rcutorture_urcu_SOURCES = urcutorture.c +rcutorture_urcu_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS) +rcutorture_urcu_LDADD = $(URCU) + +rcutorture_urcu_mb_SOURCES = urcutorture.c +rcutorture_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS) +rcutorture_urcu_mb_LDADD = $(URCU_MB_LIB) + +rcutorture_urcu_qsbr_SOURCES = urcutorture.c +rcutorture_urcu_qsbr_CFLAGS = -DTORTURE_QSBR -DRCU_QSBR $(AM_CFLAGS) +rcutorture_urcu_qsbr_LDADD = $(URCU_QSBR_LIB) + +rcutorture_urcu_signal_SOURCES = urcutorture.c +rcutorture_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) +rcutorture_urcu_signal_LDADD = $(URCU_SIGNAL_LIB) + +rcutorture_urcu_bp_SOURCES = urcutorture.c +rcutorture_urcu_bp_CFLAGS = -DRCU_BP $(AM_CFLAGS) +rcutorture_urcu_bp_LDADD = $(URCU_BP_LIB) + +urcutorture.c: ../common/api.h + +.PHONY: regtest + +# For now, run the benchmarks too as regression tests. +# TODO: split benchmarks from regression tests +regtest: + ./test_urcu_fork + ./rcutorture_urcu + ./rcutorture_urcu_signal + ./rcutorture_urcu_mb + ./rcutorture_urcu_bp + ./rcutorture_urcu_qsbr + cd ../benchmark && ./runall.sh && cd .. diff --git a/tests/rcutorture.h b/tests/regression/rcutorture.h similarity index 100% rename from tests/rcutorture.h rename to tests/regression/rcutorture.h diff --git a/tests/test_urcu_fork.c b/tests/regression/test_urcu_fork.c similarity index 99% rename from tests/test_urcu_fork.c rename to tests/regression/test_urcu_fork.c index 6e454b5..ce0c9ca 100644 --- a/tests/test_urcu_fork.c +++ b/tests/regression/test_urcu_fork.c @@ -21,7 +21,7 @@ */ #define _GNU_SOURCE -#include "../config.h" +#include "config.h" #include #include #include diff --git a/tests/urcutorture.c b/tests/regression/urcutorture.c similarity index 100% rename from tests/urcutorture.c rename to tests/regression/urcutorture.c diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am new file mode 100644 index 0000000..1fa8b71 --- /dev/null +++ b/tests/unit/Makefile.am @@ -0,0 +1,61 @@ +AM_LDFLAGS=-lpthread +AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g + +noinst_PROGRAMS = test_uatomic \ + test_urcu_multiflavor \ + test_urcu_multiflavor_dynlink + +noinst_HEADERS = test_urcu_multiflavor.h + +if COMPAT_ARCH +COMPAT=$(top_srcdir)/compat_arch_@ARCHTYPE@.c +else +COMPAT= +endif + +if COMPAT_FUTEX +COMPAT+=$(top_srcdir)/compat_futex.c +endif + +URCU=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_QSBR=$(top_srcdir)/urcu-qsbr.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_MB uses urcu.c but -DRCU_MB must be defined +URCU_MB=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +# URCU_SIGNAL uses urcu.c but -DRCU_SIGNAL must be defined +URCU_SIGNAL=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_BP=$(top_srcdir)/urcu-bp.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) +URCU_DEFER=$(top_srcdir)/urcu.c $(top_srcdir)/urcu-pointer.c $(top_srcdir)/wfcqueue.c $(COMPAT) + +URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la +URCU_LIB=$(top_builddir)/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la + +test_uatomic_SOURCES = test_uatomic.c $(COMPAT) + +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) + +check-am: + ./test_uatomic + ./test_urcu_multiflavor + ./test_urcu_multiflavor_dynlink diff --git a/tests/test_uatomic.c b/tests/unit/test_uatomic.c similarity index 100% rename from tests/test_uatomic.c rename to tests/unit/test_uatomic.c diff --git a/tests/test_urcu_multiflavor-bp.c b/tests/unit/test_urcu_multiflavor-bp.c similarity index 100% rename from tests/test_urcu_multiflavor-bp.c rename to tests/unit/test_urcu_multiflavor-bp.c diff --git a/tests/test_urcu_multiflavor-mb.c b/tests/unit/test_urcu_multiflavor-mb.c similarity index 100% rename from tests/test_urcu_multiflavor-mb.c rename to tests/unit/test_urcu_multiflavor-mb.c diff --git a/tests/test_urcu_multiflavor-memb.c b/tests/unit/test_urcu_multiflavor-memb.c similarity index 100% rename from tests/test_urcu_multiflavor-memb.c rename to tests/unit/test_urcu_multiflavor-memb.c diff --git a/tests/test_urcu_multiflavor-qsbr.c b/tests/unit/test_urcu_multiflavor-qsbr.c similarity index 100% rename from tests/test_urcu_multiflavor-qsbr.c rename to tests/unit/test_urcu_multiflavor-qsbr.c diff --git a/tests/test_urcu_multiflavor-signal.c b/tests/unit/test_urcu_multiflavor-signal.c similarity index 100% rename from tests/test_urcu_multiflavor-signal.c rename to tests/unit/test_urcu_multiflavor-signal.c diff --git a/tests/test_urcu_multiflavor.c b/tests/unit/test_urcu_multiflavor.c similarity index 100% rename from tests/test_urcu_multiflavor.c rename to tests/unit/test_urcu_multiflavor.c diff --git a/tests/test_urcu_multiflavor.h b/tests/unit/test_urcu_multiflavor.h similarity index 100% rename from tests/test_urcu_multiflavor.h rename to tests/unit/test_urcu_multiflavor.h diff --git a/tests/urcu-asm.c b/tests/unit/urcu-asm.c similarity index 100% rename from tests/urcu-asm.c rename to tests/unit/urcu-asm.c -- 2.34.1