source: tests/Makefile.am@ c309af1

Last change on this file since c309af1 was d84f2ae, checked in by Michael Brooks <mlbrooks@…>, 10 months ago

Fix transpiler-induced unused parameter on layoutof.

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