source: tests/Makefile.am@ 0bf03ba2

stuck-waitfor-destruct
Last change on this file since 0bf03ba2 was 0bf03ba2, checked in by Michael Brooks <mlbrooks@…>, 15 months ago

Remove warnings due to unused parameters in generated code for zero-length ttype instantiations.

  • Property mode set to 100644
File size: 15.9 KB
Line 
1######################## -*- Mode: Makefile-Automake -*- ######################
2##
3## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
4##
5## The contents of this file are covered under the licence agreement in the
6## file "LICENCE" distributed with Cforall.
7##
8## Makefile.am --
9##
10## Author : Peter A. Buhr
11## Created On : Sun May 31 09:08:15 2015
12## Last Modified By : Peter A. Buhr
13## Last Modified On : Thu Dec 19 22:11:14 2024
14## Update Count : 200
15###############################################################################
16
17AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names
18ACLOCAL_AMFLAGS = -I automake
19
20include $(top_srcdir)/tools/build/cfa.make
21
22DEFAULT_INCLUDES = -I${abs_srcdir}
23
24debug ?= yes
25installed ?= no
26ARCH = ${if ${arch},"--arch=${arch}"}
27arch_support = "x86/x64/arm"
28TIMEOUT = ${if ${timeout},"--timeout=${timeout}"}
29GLOBAL_TIMEOUT = ${if ${global-timeout},"--global-timeout=${global-timeout}"}
30ARCHIVE_ERRORS = ${if ${archive-errors},"--archive-errors=${archive-errors}"}
31
32DEBUG_FLAGS = -debug -g -O0
33
34quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes meta/dumpable
35
36TEST_PY = python3 ${builddir}/test.py
37
38WFLAGS_STRICT = \
39 -Wall \
40 -Wextra \
41 -Werror
42
43WFLAGS_LAX = \
44 -Wall \
45 -Werror=return-type \
46 -Wno-unused-function \
47 -Wno-psabi
48
49# These tests opt for lax wflags. (By default, new tests get strict wflags.)
50# Indented list entries are finer-grained targets under the test.
51# Making this association implicit would be ideal, but requires learning more automake than is affordable.
52WFLGAS_OPT_LAX = \
53 alloc \
54 array \
55 array-collections/array-raii-c \
56 array-collections/array-raii-cfa \
57 array-collections/boxed \
58 array-collections/boxed% \
59 array-collections/dimexpr-match-c \
60 array-collections/dimexpr-match-cfa \
61 array-ERR1 \
62 array-ERR2 \
63 array-ERR3 \
64 attributes \
65 attr-priority \
66 builtins/sync \
67 cast \
68 collections/atomic_mpsc \
69 collections/multi_list \
70 collections/queue \
71 collections/sequence \
72 collections/stack \
73 collections/vector-demo \
74 concurrency/actors/dynamic \
75 concurrency/actors/executor \
76 concurrency/actors/inherit \
77 concurrency/actors/inline \
78 concurrency/actors/matrixMultiply \
79 concurrency/actors/pingpong \
80 concurrency/actors/poison \
81 concurrency/actors/static \
82 concurrency/actors/types \
83 concurrency/barrier/generation \
84 concurrency/barrier/last \
85 concurrency/barrier/order \
86 concurrency/channels/big_elems \
87 concurrency/channels/churn \
88 concurrency/channels/contend \
89 concurrency/channels/daisy_chain \
90 concurrency/channels/hot_potato \
91 concurrency/channels/ping_pong \
92 concurrency/channels/pub_sub \
93 concurrency/channels/zero_size \
94 concurrency/cluster \
95 concurrency/cofor \
96 concurrency/coroutineYield \
97 concurrency/examples/boundedBufferEXT \
98 concurrency/examples/boundedBufferINT \
99 concurrency/futures/multi \
100 concurrency/futures/select_future \
101 concurrency/futures/typed \
102 concurrency/futures/wait_any \
103 concurrency/join \
104 concurrency/lockfree_stack \
105 concurrency/migrate \
106 concurrency/monitor \
107 concurrency/multi-monitor \
108 concurrency/mutexstmt/locks \
109 concurrency/mutexstmt/monitors \
110 concurrency/mutexstmt/tuple \
111 concurrency/once \
112 concurrency/preempt \
113 concurrency/pthread/bounded_buffer \
114 concurrency/pthread/pthread_attr_test \
115 concurrency/pthread/pthread_cond_test \
116 concurrency/pthread/pthread_demo_create_join \
117 concurrency/pthread/pthread_demo_lock \
118 concurrency/pthread/pthread_key_test \
119 concurrency/pthread/pthread_once_test \
120 concurrency/readyQ/leader_spin \
121 concurrency/signal/block \
122 concurrency/signal/disjoint \
123 concurrency/signal/wait \
124 concurrency/sleep \
125 concurrency/suspend_then \
126 concurrency/thread \
127 concurrency/unified_locking/block_spin_lock \
128 concurrency/unified_locking/exp_backoff \
129 concurrency/unified_locking/fast_block_lock \
130 concurrency/unified_locking/futex_mutex \
131 concurrency/unified_locking/locks \
132 concurrency/unified_locking/mcs \
133 concurrency/unified_locking/mcs_block_spin_lock \
134 concurrency/unified_locking/mcs_spin \
135 concurrency/unified_locking/pthread_locks \
136 concurrency/unified_locking/simple_owner_lock \
137 concurrency/unified_locking/spin_queue_lock \
138 concurrency/unified_locking/timeout_lock \
139 concurrency/waitfor/barge \
140 concurrency/waitfor/parse \
141 concurrency/waitfor/statment \
142 concurrency/waitfor/when \
143 concurrency/waituntil/all_types \
144 concurrency/waituntil/basic_else \
145 concurrency/waituntil/channel_close \
146 concurrency/waituntil/channel_zero_size \
147 concurrency/waituntil/channels \
148 concurrency/waituntil/futures \
149 concurrency/waituntil/locks \
150 concurrency/waituntil/one_chan \
151 concurrency/waituntil/repeat_close \
152 concurrency/waituntil/timeout \
153 configs/parsebools \
154 configs/parsenums \
155 configs/usage \
156 coroutine/raii \
157 ctrl-flow/goto \
158 ctrl-flow/ifwhileCtl \
159 ctrl-flow/labelledExit \
160 ctrl-flow/loop_else \
161 designations \
162 enum \
163 enum_tests/inc-dec \
164 enum_tests/planet \
165 enum_tests/structEnum \
166 exceptions/cardgame \
167 exceptions/defaults \
168 exceptions/defaults-threads \
169 exceptions/hotpotato \
170 exceptions/hotpotato_checked \
171 exceptions/pingpong_nonlocal \
172 exceptions/polymorphic \
173 exceptions/try-leave-catch \
174 exceptions/virtual-poly \
175 expression \
176 forall \
177 function-operator \
178 gmp \
179 identFuncDeclarator \
180 identParamDeclarator \
181 include/includes \
182 include/stdincludes \
183 include/vector-collections \
184 include/vector-fstream \
185 include/vector-sequence \
186 init1 \
187 init1-ERROR \
188 io/away_fair \
189 io/comp_basic \
190 io/comp_fair \
191 io/io-acquire \
192 io/io-acquire2 \
193 io/io-acquire-in \
194 io/io-acquire-no-io \
195 io/io-acquire-out \
196 io/manipulatorsInput \
197 io/manipulatorsInput-uchunk \
198 io/many_read \
199 limits \
200 linking/io-acquire \
201 linking/mangling/anon \
202 linking/mangling/lib.o \
203 linking/mangling/main.o \
204 linkonce \
205 link-once/% \
206 malloc \
207 math \
208 mathX \
209 maybe \
210 minmax \
211 nested-types \
212 nested-types-ERR1 \
213 nested-types-ERR2 \
214 numericConstants \
215 operators \
216 poly-d-cycle \
217 poly-many-arsz \
218 poly-member \
219 polymorphism \
220 poly-o-cycle \
221 PRNG \
222 quasiKeyword \
223 quotedKeyword \
224 raii/boxed-types \
225 raii/ctor-autogen \
226 raii/dtor-early-exit \
227 raii/init_once \
228 raii/partial \
229 references \
230 result \
231 shortCircuit \
232 sizeof \
233 smart-pointers \
234 sum \
235 switch \
236 tuple/tupleAssign \
237 tuple/tupleCast \
238 tuple/tupleMember \
239 tuple/tuplePolymorphism \
240 tuple/tupleVariadic \
241 typedefRedef \
242 typedefRedef-ERR1 \
243 typeof \
244 userLiterals \
245 variableDeclarator \
246 vector \
247 warnings/self-assignment
248
249WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
250
251# applies to both programs
252# since automake doesn't have support for CFA we have to
253AM_CFLAGS = ${if ${test}, 2> ${test}, } \
254 -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
255 -fdebug-prefix-map=/tmp= \
256 -fno-diagnostics-show-caret \
257 -g \
258 $(WFLAGS) \
259 -quiet @CFA_FLAGS@
260
261AM_CFAFLAGS = -XCFA --deterministic-out
262
263# get the desired cfa to test
264TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
265
266# adjust CC to current flags
267CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
268CFACC = ${CC}
269
270# get local binary for depedencies
271CFACCBIN = @CFACC@
272
273# adjusted CC but without the actual distcc call
274CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
275CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
276
277PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
278
279.PHONY : concurrency list .validate .test_makeflags
280.INTERMEDIATE : .validate .validate.cfa .test_makeflags
281EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
282EXTRA_DIST = test.py \
283 pybin/__init__.py \
284 pybin/print-core.gdb \
285 pybin/settings.py \
286 pybin/test_run.py \
287 pybin/tools.py \
288 long_tests.hfa \
289 array-collections/boxed.hfa \
290 array-collections/boxed.cases.hfa \
291 avltree/avl-private.h \
292 avltree/avl.h \
293 exceptions/except-io.hfa \
294 exceptions/with-threads.hfa \
295 meta/fork+exec.hfa \
296 concurrency/clib_tls.c \
297 concurrency/clib.c \
298 concurrency/unified_locking/mutex_test.hfa \
299 concurrency/channels/parallel_harness.hfa \
300 array-collections/dimexpr-match.hfa \
301 array-collections/dimexpr-match-detail.sh \
302 array-collections/array-raii.hfa
303
304dist-hook:
305 echo "Gathering test files"
306 for file in `${TEST_PY} --list-dist`; do \
307 if ls ${srcdir}/$${file} > /dev/null 2>&1; then \
308 ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
309 cp -df ${srcdir}/$${file} $$(dirname ${distdir}/$${file}); \
310 fi; \
311 done
312
313array_collections_boxed_SOURCES = array-collections/boxed.main.cfa array-collections/boxed.bookend.cfa
314avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
315linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
316linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa
317# automake doesn't know we still need C/CPP rules so pretend like we have a C program
318nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
319
320#----------------------------------------------------------------------------------------------------------------
321
322# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
323all-local : # This name is important to automake and implies the default build target.
324 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all
325
326tests : all-local # synonym
327
328install : all-local # synonym, PAB only
329
330quick :
331 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test}
332
333concurrency :
334 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency
335
336list :
337 @+${TEST_PY} --list
338
339help :
340 @echo "user targets:"
341 @echo " Run the complete test suite."
342 @echo " $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
343 @echo ""
344 @echo " Run the short (quick) test suite."
345 @echo " $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]"
346 @echo ""
347 @echo " Run the concurrency test suite."
348 @echo " $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
349 @echo ""
350 @echo " List all tests in the test suite."
351 @echo " $$ make list"
352
353mostlyclean-local :
354 find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
355 find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
356 find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
357 rm -f ${EXTRA_PROGRAMS}
358 rm -rf __pycache__
359
360distclean-local :
361 find ${builddir} -path '*.Po' -delete
362
363.test_makeflags:
364 @echo "${MAKEFLAGS}"
365
366.validate: .validate.cfa
367 ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
368
369.validate.cfa:
370 @echo "int main() { return 0; }" > ${@}
371
372# automake doesn't know we still need C rules so pretend like we have a C program
373.dummy_hack.c:
374 @echo "int main() { return 0; }" > ${@}
375
376.dummy_hackxx.cpp:
377 @echo "int bar() { return 0; }" > ${@}
378
379#----------------------------------------------------------------------------------------------------------------
380
381# Use for all tests, make sure the path are correct and all flags are added
382CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
383
384#----------------------------------------------------------------------------------------------------------------
385
386# implicit rule so not all test require a rule
387# split into two steps to support compiling remotely using distcc
388# don't use distcc to do the linking because distcc doesn't do linking
389% : %.cfa ${CFACCBIN}
390 ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
391 ${CFACCLINK} ${@}.o -o ${abspath ${@}}
392 rm ${abspath ${@}}.o
393
394# implicit rule for c++ test
395# convient for testing the testsuite itself but not actuall used
396% : %.cpp
397 ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
398
399#------------------------------------------------------------------------------
400# TARGETS WITH CUSTOM FLAGS
401#------------------------------------------------------------------------------
402# custom libs
403gmp_FLAGSLD= -lgmp
404
405#------------------------------------------------------------------------------
406# Generated code
407GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
408${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
409 ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
410
411#------------------------------------------------------------------------------
412# CUSTOM TARGET
413#------------------------------------------------------------------------------
414# tests that just validate syntax and compiler output should be compared to stderr
415CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
416
417SYNTAX_ONLY_CODE = \
418 array cast expression identFuncDeclarator init1 limits nested-types numericConstants opt-params quasiKeyword switch typedefRedef variableDeclarator \
419 builtins/sync concurrency/waitfor/parse ctrl-flow/labelledExit include/stdincludes include/includes warnings/self-assignment
420
421${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
422 ${CFACOMPILE_SYNTAX}
423 ${if ${test}, cp ${test} ${abspath ${@}}, }
424
425# expected failures
426# use custom target since they require a custom define *and* have a name that doesn't match the file
427
428array-ERR1 : array.cfa ${CFACCBIN}
429 ${CFACOMPILE_SYNTAX} -DERR1
430 -cp ${test} ${abspath ${@}}
431
432array-ERR2 : array.cfa ${CFACCBIN}
433 ${CFACOMPILE_SYNTAX} -DERR2
434 -cp ${test} ${abspath ${@}}
435
436array-ERR3 : array.cfa ${CFACCBIN}
437 ${CFACOMPILE_SYNTAX} -DERR3
438 -cp ${test} ${abspath ${@}}
439
440array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa
441 ${CFACOMPILE_SYNTAX} -DERRS
442 -cp ${test} ${abspath ${@}}
443
444array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa
445 ${CFACOMPILE_SYNTAX} -DERRS
446 -cp ${test} ${abspath ${@}}
447
448alloc-ERROR : alloc.cfa ${CFACCBIN}
449 ${CFACOMPILE_SYNTAX} -DERR1
450 -cp ${test} ${abspath ${@}}
451
452init1-ERROR : init1.cfa ${CFACCBIN}
453 ${CFACOMPILE_SYNTAX} -DERR1
454 -cp ${test} ${abspath ${@}}
455
456typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
457 ${CFACOMPILE_SYNTAX} -DERR1
458 -cp ${test} ${abspath ${@}}
459
460nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
461 ${CFACOMPILE_SYNTAX} -DERR1
462 -cp ${test} ${abspath ${@}}
463
464nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
465 ${CFACOMPILE_SYNTAX} -DERR2
466 -cp ${test} ${abspath ${@}}
467
468raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
469 ${CFACOMPILE_SYNTAX} -DERR1
470 -cp ${test} ${abspath ${@}}
471
472raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
473 ${CFACOMPILE_SYNTAX} -DERR1
474 -cp ${test} ${abspath ${@}}
475
476raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
477 ${CFACOMPILE_SYNTAX} -DERR1
478 -cp ${test} ${abspath ${@}}
479
480raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
481 ${CFACOMPILE_SYNTAX} -DERR2
482 -cp ${test} ${abspath ${@}}
483
484raii/partial-ERR1 : raii/partial.cfa ${CFACCBIN}
485 ${CFACOMPILE_SYNTAX} -DERR1
486 -cp ${test} ${abspath ${@}}
487
488# Exception Tests
489# Test with libcfathread; it changes how storage works.
490
491exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
492 ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
493 ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
494
495# Linking tests
496# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
497linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
498 ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
499 ${CFACCLINK} -O0 ${@}.o -o ${abspath ${@}}
500 rm ${abspath ${@}}.o
501
502#------------------------------------------------------------------------------
503# Other targets
Note: See TracBrowser for help on using the repository browser.