source: tests/Makefile.am@ 507fc97

stuck-waitfor-destruct
Last change on this file since 507fc97 was 507fc97, checked in by Matthew Au-Yeung <mw2auyeu@…>, 40 hours ago

test associated with it

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