1 # SPDX-FileCopyrightText: 2023 EfficiOS Inc.
3 # SPDX-License-Identifier: MIT
5 AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/common
6 AM_CPPFLAGS += -include $(top_srcdir)/tests/benchmark/common-states.h
9 TAP_LOG_DRIVER_FLAGS = --merge --comments
10 TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \
11 URCU_TESTS_SRCDIR='$(abs_top_srcdir)/tests' \
12 URCU_TESTS_BUILDDIR='$(abs_top_builddir)/tests' \
13 $(SHELL) $(top_srcdir)/tests/utils/tap-driver.sh
15 noinst_HEADERS = common-states.h
27 dist_noinst_SCRIPTS = \
35 hashtable_1_seconds.tap \
37 hashtable_3_seconds.tap \
39 hashtable_30_seconds.tap \
42 noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \
43 test_urcu_signal test_urcu_signal_dynamic_link test_urcu_signal_timing \
44 test_rwlock_timing test_rwlock test_perthreadlock_timing \
45 test_perthreadlock test_urcu_yield test_urcu_signal_yield test_urcu_mb \
46 test_urcu_qsbr_timing test_urcu_qsbr \
47 test_mutex test_looplen test_urcu_gc test_urcu_signal_gc \
49 test_urcu_mb_gc test_urcu_qsbr_gc test_urcu_qsbr_lgc test_urcu_signal_lgc \
50 test_urcu_mb_lgc test_urcu_qsbr_dynamic_link test_urcu_defer \
51 test_urcu_assign test_urcu_assign_dynamic_link \
52 test_urcu_bp test_urcu_bp_dynamic_link test_cycles_per_loop \
53 test_urcu_lfq test_urcu_wfq test_urcu_lfs test_urcu_wfs \
56 test_urcu_wfq_dynlink test_urcu_wfs_dynlink \
57 test_urcu_wfcq_dynlink \
58 test_urcu_lfq_dynlink test_urcu_lfs_dynlink test_urcu_hash \
59 test_urcu_lfs_rcu_dynlink
61 URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la
62 URCU_LIB=$(top_builddir)/src/liburcu.la
63 URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la
64 URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la
65 URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la
66 URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la
67 URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la
69 DEBUG_YIELD_LIB=$(builddir)/../common/libdebug-yield.la
71 test_urcu_SOURCES = test_urcu.c common-states.c
72 test_urcu_LDADD = $(URCU_LIB)
74 test_urcu_dynamic_link_SOURCES = test_urcu.c common-states.c
75 test_urcu_dynamic_link_LDADD = $(URCU_LIB)
76 test_urcu_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
78 test_urcu_timing_SOURCES = test_urcu_timing.c common-states.c
79 test_urcu_timing_LDADD = $(URCU_LIB)
81 test_urcu_yield_SOURCES = test_urcu.c common-states.c
82 test_urcu_yield_LDADD = $(URCU_LIB) $(DEBUG_YIELD_LIB)
83 test_urcu_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS)
86 test_urcu_qsbr_SOURCES = test_urcu_qsbr.c common-states.c
87 test_urcu_qsbr_LDADD = $(URCU_QSBR_LIB)
89 test_urcu_qsbr_timing_SOURCES = test_urcu_qsbr_timing.c common-states.c
90 test_urcu_qsbr_timing_LDADD = $(URCU_QSBR_LIB)
93 test_urcu_mb_SOURCES = test_urcu.c common-states.c
94 test_urcu_mb_LDADD = $(URCU_MB_LIB)
95 test_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS)
98 test_urcu_signal_SOURCES = test_urcu.c common-states.c
99 test_urcu_signal_LDADD = $(URCU_SIGNAL_LIB)
100 test_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS)
102 test_urcu_signal_dynamic_link_SOURCES = test_urcu.c common-states.c
103 test_urcu_signal_dynamic_link_LDADD = $(URCU_SIGNAL_LIB)
104 test_urcu_signal_dynamic_link_CFLAGS = -DRCU_SIGNAL -DDYNAMIC_LINK_TEST \
107 test_urcu_signal_timing_SOURCES = test_urcu_timing.c common-states.c
108 test_urcu_signal_timing_LDADD = $(URCU_SIGNAL_LIB)
109 test_urcu_signal_timing_CFLAGS= -DRCU_SIGNAL $(AM_CFLAGS)
111 test_urcu_signal_yield_SOURCES = test_urcu.c common-states.c
112 test_urcu_signal_yield_LDADD = $(URCU_SIGNAL_LIB) $(DEBUG_YIELD_LIB)
113 test_urcu_signal_yield_CFLAGS = -DRCU_SIGNAL -DDEBUG_YIELD $(AM_CFLAGS)
115 test_rwlock_timing_SOURCES = test_rwlock_timing.c common-states.c
116 test_rwlock_timing_LDADD = $(URCU_SIGNAL_LIB)
118 test_rwlock_SOURCES = test_rwlock.c common-states.c
119 test_rwlock_LDADD = $(URCU_SIGNAL_LIB)
121 test_perthreadlock_timing_SOURCES = test_perthreadlock_timing.c common-states.c
122 test_perthreadlock_timing_LDADD = $(URCU_SIGNAL_LIB)
124 test_perthreadlock_SOURCES = test_perthreadlock.c common-states.c
125 test_perthreadlock_LDADD = $(URCU_SIGNAL_LIB)
127 test_mutex_SOURCES = test_mutex.c common-states.c
129 test_looplen_SOURCES = test_looplen.c common-states.c
131 test_urcu_gc_SOURCES = test_urcu_gc.c common-states.c
132 test_urcu_gc_LDADD = $(URCU_LIB)
134 test_urcu_signal_gc_SOURCES = test_urcu_gc.c common-states.c
135 test_urcu_signal_gc_LDADD = $(URCU_SIGNAL_LIB)
136 test_urcu_signal_gc_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS)
138 test_urcu_mb_gc_SOURCES = test_urcu_gc.c common-states.c
139 test_urcu_mb_gc_LDADD = $(URCU_MB_LIB)
140 test_urcu_mb_gc_CFLAGS = -DRCU_MB $(AM_CFLAGS)
142 test_urcu_qsbr_gc_SOURCES = test_urcu_qsbr_gc.c common-states.c
143 test_urcu_qsbr_gc_LDADD = $(URCU_QSBR_LIB)
145 test_urcu_qsbr_lgc_SOURCES = test_urcu_qsbr_gc.c common-states.c
146 test_urcu_qsbr_lgc_LDADD = $(URCU_QSBR_LIB)
147 test_urcu_qsbr_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS)
149 test_urcu_lgc_SOURCES = test_urcu_gc.c common-states.c
150 test_urcu_lgc_LDADD = $(URCU_LIB)
151 test_urcu_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS)
153 test_urcu_signal_lgc_SOURCES = test_urcu_gc.c common-states.c
154 test_urcu_signal_lgc_LDADD = $(URCU_SIGNAL_LIB)
155 test_urcu_signal_lgc_CFLAGS = -DRCU_SIGNAL -DTEST_LOCAL_GC $(AM_CFLAGS)
157 test_urcu_mb_lgc_SOURCES = test_urcu_gc.c common-states.c
158 test_urcu_mb_lgc_LDADD = $(URCU_MB_LIB)
159 test_urcu_mb_lgc_CFLAGS = -DTEST_LOCAL_GC -DRCU_MB $(AM_CFLAGS)
161 test_urcu_qsbr_dynamic_link_SOURCES = test_urcu_qsbr.c common-states.c
162 test_urcu_qsbr_dynamic_link_LDADD = $(URCU_QSBR_LIB)
163 test_urcu_qsbr_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
165 test_urcu_defer_SOURCES = test_urcu_defer.c common-states.c
166 test_urcu_defer_LDADD = $(URCU_LIB)
168 test_cycles_per_loop_SOURCES = test_cycles_per_loop.c
170 test_urcu_assign_SOURCES = test_urcu_assign.c common-states.c
171 test_urcu_assign_LDADD = $(URCU_LIB)
173 test_urcu_assign_dynamic_link_SOURCES = test_urcu_assign.c common-states.c
174 test_urcu_assign_dynamic_link_LDADD = $(URCU_LIB)
175 test_urcu_assign_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
177 test_urcu_bp_SOURCES = test_urcu_bp.c common-states.c
178 test_urcu_bp_LDADD = $(URCU_BP_LIB)
180 test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c common-states.c
181 test_urcu_bp_dynamic_link_LDADD = $(URCU_BP_LIB)
182 test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
184 test_urcu_lfq_SOURCES = test_urcu_lfq.c common-states.c
185 test_urcu_lfq_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
187 test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c common-states.c
188 test_urcu_lfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
189 test_urcu_lfq_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
191 test_urcu_wfq_SOURCES = test_urcu_wfq.c common-states.c
192 test_urcu_wfq_LDADD = $(URCU_COMMON_LIB)
194 test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c common-states.c
195 test_urcu_wfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
196 test_urcu_wfq_dynlink_LDADD = $(URCU_COMMON_LIB)
198 test_urcu_wfcq_SOURCES = test_urcu_wfcq.c common-states.c
199 test_urcu_wfcq_LDADD = $(URCU_COMMON_LIB)
201 test_urcu_wfcq_dynlink_SOURCES = test_urcu_wfcq.c common-states.c
202 test_urcu_wfcq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
203 test_urcu_wfcq_dynlink_LDADD = $(URCU_COMMON_LIB)
205 test_urcu_lfs_SOURCES = test_urcu_lfs.c common-states.c
206 test_urcu_lfs_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
208 test_urcu_lfs_rcu_SOURCES = test_urcu_lfs_rcu.c common-states.c
209 test_urcu_lfs_rcu_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
211 test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c common-states.c
212 test_urcu_lfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
213 test_urcu_lfs_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
215 test_urcu_lfs_rcu_dynlink_SOURCES = test_urcu_lfs_rcu.c common-states.c
216 test_urcu_lfs_rcu_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
217 test_urcu_lfs_rcu_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB)
219 test_urcu_wfs_SOURCES = test_urcu_wfs.c common-states.c
220 test_urcu_wfs_LDADD = $(URCU_COMMON_LIB)
222 test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c common-states.c
223 test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
224 test_urcu_wfs_dynlink_LDADD = $(URCU_COMMON_LIB)
226 test_urcu_hash_SOURCES = test_urcu_hash.c test_urcu_hash.h \
227 test_urcu_hash_rw.c test_urcu_hash_unique.c common-states.c
228 test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS)
229 test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_COMMON_LIB) $(URCU_CDS_LIB)
232 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
233 for script in $(SCRIPT_LIST); do \
234 cp -f $(srcdir)/$$script $(builddir); \
239 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
240 for script in $(SCRIPT_LIST); do \
241 rm -f $(builddir)/$$script; \
245 .PHONY: short_bench long_bench regtest
247 # This empty variable is required to enable the TAP test suite for custom
248 # targets like 'regtest' while keeping the default 'check' a noop.
251 SHORT_BENCH_TESTS = urcu_3_seconds.tap hashtable_3_seconds.tap
252 LONG_BENCH_TESTS = urcu_30_seconds.tap hashtable_30_seconds.tap
253 REGTEST_TESTS = urcu_1_seconds.tap hashtable_1_seconds.tap
256 $(MAKE) $(AM_MAKEFLAGS) check TESTS="$(SHORT_BENCH_TESTS)"
259 $(MAKE) $(AM_MAKEFLAGS) check TESTS="$(LONG_BENCH_TESTS)"
262 $(MAKE) $(AM_MAKEFLAGS) check TESTS="$(REGTEST_TESTS)"