source: tests/Makefile.am@ a5e2786f

Last change on this file since a5e2786f was 0cd168f, checked in by Michael Brooks <mlbrooks@…>, 13 months ago

Remove test-code-induced warnings from Array RAII.

(Depends on zero-length tuples' fix of 0bf03ba224.)

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