source: tests/Makefile.am@ 49510db

Last change on this file since 49510db was bada452, checked in by Andrew Beach <ajbeach@…>, 9 months ago

Removed warnings from serveral tests and removed them from the ..._TO_INVESTIGATE list. One test triggered a Cforall warning and a new test to check that has been added. collections/vector-demo has no warnings in its body, but the library it uses does have warnings and will have to move after that is fixed.

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