source: tests/Makefile.am@ 90e683b

stuck-waitfor-destruct
Last change on this file since 90e683b was bbbff10, checked in by Peter A. Buhr <pabuhr@…>, 13 months ago

update loop_else test to handle warnings

  • Property mode set to 100644
File size: 13.0 KB
RevLine 
[ef7d253]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
[bbbff10]13## Last Modified On : Sat Feb 1 08:20:27 2025
14## Update Count : 201
[ef7d253]15###############################################################################
16
[0c1b566]17AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names
[107b01a]18ACLOCAL_AMFLAGS = -I automake
[f85bc15]19
[bcadb26]20include $(top_srcdir)/tools/build/cfa.make
[dc8511c]21
[e2887a9]22DEFAULT_INCLUDES = -I${abs_srcdir}
[74cfe054]23
[4daf79f]24debug ?= yes
25installed ?= no
[e3d4fd1]26ARCH = ${if ${arch},"--arch=${arch}"}
27arch_support = "x86/x64/arm"
[bdbf536]28TIMEOUT = ${if ${timeout},"--timeout=${timeout}"}
[5007618]29GLOBAL_TIMEOUT = ${if ${global-timeout},"--global-timeout=${global-timeout}"}
30ARCHIVE_ERRORS = ${if ${archive-errors},"--archive-errors=${archive-errors}"}
31
[e3d4fd1]32DEBUG_FLAGS = -debug -g -O0
[e3a5a73]33
[e3d4fd1]34quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes meta/dumpable
[be65cca]35
[e2887a9]36TEST_PY = python3 ${builddir}/test.py
[f85bc15]37
[faf9e19]38WFLAGS_STRICT = \
39 -Wall \
40 -Wextra \
[656c8ac]41 -Werror
[faf9e19]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.
[584612d]52WFLGAS_OPT_LAX = \
[2853d6f]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 \
[bbbff10]59 ctrl-flow/loop_else-WRN1 \
[2853d6f]60 warnings/self-assignment
61
62# Tests that need investigation from the CFA team about why they require lax wflags. Goal is to eliminate this list.
63WFLGAS_OPT_LAX_TO_INVESTIGATE = \
[faf9e19]64 collections/vector-demo \
65 concurrency/actors/dynamic \
66 concurrency/actors/executor \
67 concurrency/actors/inherit \
68 concurrency/actors/inline \
69 concurrency/actors/matrixMultiply \
70 concurrency/actors/pingpong \
71 concurrency/actors/poison \
72 concurrency/actors/static \
73 concurrency/actors/types \
74 concurrency/channels/churn \
75 concurrency/channels/contend \
76 concurrency/channels/daisy_chain \
77 concurrency/channels/hot_potato \
78 concurrency/channels/pub_sub \
79 concurrency/futures/multi \
80 concurrency/futures/select_future \
81 concurrency/futures/typed \
82 concurrency/lockfree_stack \
83 concurrency/pthread/bounded_buffer \
84 concurrency/pthread/pthread_attr_test \
85 concurrency/pthread/pthread_demo_create_join \
86 concurrency/pthread/pthread_demo_lock \
87 concurrency/pthread/pthread_key_test \
88 concurrency/waituntil/all_types \
89 concurrency/waituntil/basic_else \
90 concurrency/waituntil/channel_close \
91 concurrency/waituntil/channels \
92 concurrency/waituntil/futures \
93 concurrency/waituntil/locks \
94 concurrency/waituntil/repeat_close \
95 concurrency/waituntil/timeout \
96 exceptions/cardgame \
97 exceptions/defaults \
98 exceptions/defaults-threads \
99 exceptions/try-leave-catch \
[372d33c]100 forall \
[faf9e19]101 include/includes \
102 include/stdincludes \
103 include/vector-collections \
104 include/vector-fstream \
105 include/vector-sequence \
106 io/away_fair \
107 io/comp_basic \
108 io/comp_fair \
109 io/manipulatorsInput \
110 io/manipulatorsInput-uchunk \
111 io/many_read \
112 raii/ctor-autogen \
113 raii/dtor-early-exit \
114 raii/init_once \
115 references \
116 tuple/tupleCast \
[641707d]117 tuple/tupleMember
[faf9e19]118
119WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
120
[ef7d253]121# applies to both programs
[d65f92c]122# since automake doesn't have support for CFA we have to
[e2887a9]123AM_CFLAGS = ${if ${test}, 2> ${test}, } \
124 -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
[87fc1b4]125 -fdebug-prefix-map=/tmp= \
[0a19c51]126 -fno-diagnostics-show-caret \
[b8f6002]127 -g \
[faf9e19]128 $(WFLAGS) \
[b44959f]129 -quiet @CFA_FLAGS@
[7c03d6d]130
[7215000]131AM_CFAFLAGS = -XCFA --deterministic-out
132
[158b026]133# get the desired cfa to test
[e2887a9]134TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
[158b026]135
[34e1494]136# adjust CC to current flags
[e2887a9]137CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
138CFACC = ${CC}
[ef7d253]139
[34e1494]140# get local binary for depedencies
141CFACCBIN = @CFACC@
142
143# adjusted CC but without the actual distcc call
[e2887a9]144CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
145CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
[34e1494]146
[e3d4fd1]147PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
[f7d3215]148
[bdbf536]149.PHONY : concurrency list .validate .test_makeflags
[e2887a9]150.INTERMEDIATE : .validate .validate.cfa .test_makeflags
[fd4df379]151EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
[a468e1e9]152EXTRA_DIST = test.py \
153 pybin/__init__.py \
154 pybin/print-core.gdb \
155 pybin/settings.py \
156 pybin/test_run.py \
157 pybin/tools.py \
158 long_tests.hfa \
[fd4df379]159 array-collections/boxed.hfa \
160 array-collections/boxed.cases.hfa \
[d0fa494]161 avltree/avl-private.h \
162 avltree/avl.h \
163 exceptions/except-io.hfa \
164 exceptions/with-threads.hfa \
165 meta/fork+exec.hfa \
[c26bea2a]166 concurrency/clib_tls.c \
167 concurrency/clib.c \
168 concurrency/unified_locking/mutex_test.hfa \
[9c4330d5]169 concurrency/channels/parallel_harness.hfa \
[0b8c951d]170 array-collections/dimexpr-match.hfa \
[ee16f8fc]171 array-collections/dimexpr-match-detail.sh \
172 array-collections/array-raii.hfa
[a468e1e9]173
174dist-hook:
175 echo "Gathering test files"
[e2887a9]176 for file in `${TEST_PY} --list-dist`; do \
[b24cbaf]177 if ls ${srcdir}/$${file} > /dev/null 2>&1; then \
[e2887a9]178 ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
[b24cbaf]179 cp -df ${srcdir}/$${file} $$(dirname ${distdir}/$${file}); \
[a468e1e9]180 fi; \
181 done
[44f44617]182
[fd4df379]183array_collections_boxed_SOURCES = array-collections/boxed.main.cfa array-collections/boxed.bookend.cfa
[107b01a]184avl_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
[aff7e86]185linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
[258aaab8]186linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa
[2b10f95]187# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]188nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]189
[73abe95]190#----------------------------------------------------------------------------------------------------------------
[4daf79f]191
[5007618]192# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
[c083c3d]193all-local : # This name is important to automake and implies the default build target.
[d144c26]194 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all
[4daf79f]195
[5007618]196tests : all-local # synonym
[4daf79f]197
[5007618]198install : all-local # synonym, PAB only
[df42128]199
[4daf79f]200quick :
[5007618]201 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test}
[e2887a9]202
203concurrency :
[5007618]204 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency
[e2887a9]205
206list :
[bdbf536]207 @+${TEST_PY} --list
[e2887a9]208
209help :
210 @echo "user targets:"
211 @echo " Run the complete test suite."
[5007618]212 @echo " $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
[e2887a9]213 @echo ""
214 @echo " Run the short (quick) test suite."
[5007618]215 @echo " $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]"
[e2887a9]216 @echo ""
[bdbf536]217 @echo " Run the concurrency test suite."
[5007618]218 @echo " $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
[e2887a9]219 @echo ""
220 @echo " List all tests in the test suite."
221 @echo " $$ make list"
[927e9ce]222
[2a59655]223mostlyclean-local :
[e2887a9]224 find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
225 find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
226 find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
227 rm -f ${EXTRA_PROGRAMS}
[2a59655]228 rm -rf __pycache__
229
230distclean-local :
[e2887a9]231 find ${builddir} -path '*.Po' -delete
[927e9ce]232
[fc01219]233.test_makeflags:
[e2887a9]234 @echo "${MAKEFLAGS}"
[fc01219]235
[1e995d6]236.validate: .validate.cfa
[e2887a9]237 ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
[1e995d6]238
239.validate.cfa:
[e2887a9]240 @echo "int main() { return 0; }" > ${@}
[28582b2]241
[107b01a]242# automake doesn't know we still need C rules so pretend like we have a C program
243.dummy_hack.c:
[e2887a9]244 @echo "int main() { return 0; }" > ${@}
[28582b2]245
[2b10f95]246.dummy_hackxx.cpp:
[e2887a9]247 @echo "int bar() { return 0; }" > ${@}
[026a0f5]248
[73abe95]249#----------------------------------------------------------------------------------------------------------------
[dc8511c]250
[e16797c]251# Use for all tests, make sure the path are correct and all flags are added
[e2887a9]252CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
[d9b499c]253
[e16797c]254#----------------------------------------------------------------------------------------------------------------
[a843067]255
[e16797c]256# implicit rule so not all test require a rule
[15f9c8e]257# split into two steps to support compiling remotely using distcc
[34e1494]258# don't use distcc to do the linking because distcc doesn't do linking
[e2887a9]259% : %.cfa ${CFACCBIN}
260 ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
261 ${CFACCLINK} ${@}.o -o ${abspath ${@}}
262 rm ${abspath ${@}}.o
[f7d3215]263
[34e1494]264# implicit rule for c++ test
265# convient for testing the testsuite itself but not actuall used
[e16797c]266% : %.cpp
[e2887a9]267 ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
[4c8f86b3]268
[f7d3215]269#------------------------------------------------------------------------------
[34e1494]270# TARGETS WITH CUSTOM FLAGS
[e16797c]271#------------------------------------------------------------------------------
[34e1494]272# custom libs
273gmp_FLAGSLD= -lgmp
[dc8511c]274
[e16797c]275#------------------------------------------------------------------------------
[34e1494]276# Generated code
277GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
[e2887a9]278${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
279 ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
[34e1494]280
[e16797c]281#------------------------------------------------------------------------------
282# CUSTOM TARGET
283#------------------------------------------------------------------------------
[66812dd]284# tests that just validate syntax and compiler output should be compared to stderr
[e2887a9]285CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
[40c81e5]286
[2853d6f]287SYNTAX_ONLY_CODE = attr-priority warnings/self-assignment
[afb15cf]288
[e2887a9]289${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
290 ${CFACOMPILE_SYNTAX}
291 ${if ${test}, cp ${test} ${abspath ${@}}, }
[87fc1b4]292
[34e1494]293# expected failures
[e6cfb4e2]294# use custom target since they require a custom define *and* have a name that doesn't match the file
[a5aa5bf]295
296array-ERR1 : array.cfa ${CFACCBIN}
297 ${CFACOMPILE_SYNTAX} -DERR1
298 -cp ${test} ${abspath ${@}}
299
300array-ERR2 : array.cfa ${CFACCBIN}
301 ${CFACOMPILE_SYNTAX} -DERR2
302 -cp ${test} ${abspath ${@}}
303
304array-ERR3 : array.cfa ${CFACCBIN}
305 ${CFACOMPILE_SYNTAX} -DERR3
306 -cp ${test} ${abspath ${@}}
307
[0b8c951d]308array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa
[0f4ac10]309 ${CFACOMPILE_SYNTAX} -DERRS
310 -cp ${test} ${abspath ${@}}
311
[0b8c951d]312array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa
[0f4ac10]313 ${CFACOMPILE_SYNTAX} -DERRS
314 -cp ${test} ${abspath ${@}}
315
[e2887a9]316alloc-ERROR : alloc.cfa ${CFACCBIN}
317 ${CFACOMPILE_SYNTAX} -DERR1
318 -cp ${test} ${abspath ${@}}
[b93a3de]319
[e2887a9]320init1-ERROR : init1.cfa ${CFACCBIN}
321 ${CFACOMPILE_SYNTAX} -DERR1
322 -cp ${test} ${abspath ${@}}
[ee858bf]323
[e2887a9]324typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
325 ${CFACOMPILE_SYNTAX} -DERR1
326 -cp ${test} ${abspath ${@}}
[e2c70ab]327
[e2887a9]328nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
329 ${CFACOMPILE_SYNTAX} -DERR1
330 -cp ${test} ${abspath ${@}}
[49e1275]331
[e2887a9]332nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
333 ${CFACOMPILE_SYNTAX} -DERR2
334 -cp ${test} ${abspath ${@}}
[49e1275]335
[e2887a9]336raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
337 ${CFACOMPILE_SYNTAX} -DERR1
338 -cp ${test} ${abspath ${@}}
[cdbfab0]339
[e2887a9]340raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
341 ${CFACOMPILE_SYNTAX} -DERR1
342 -cp ${test} ${abspath ${@}}
[80e85829]343
[e2887a9]344raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
345 ${CFACOMPILE_SYNTAX} -DERR1
346 -cp ${test} ${abspath ${@}}
[80e85829]347
[e2887a9]348raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
349 ${CFACOMPILE_SYNTAX} -DERR2
350 -cp ${test} ${abspath ${@}}
[e16797c]351
[64f3b9f]352raii/partial-ERR1 : raii/partial.cfa ${CFACCBIN}
353 ${CFACOMPILE_SYNTAX} -DERR1
354 -cp ${test} ${abspath ${@}}
355
[bbbff10]356ctrl-flow/loop_else : ctrl-flow/loop_else.cfa ${CFACCBIN}
357 ${CC} ${AM_CFLAGS} -Wno-superfluous-else $< -o $@
358
359ctrl-flow/loop_else-WRN1 : ctrl-flow/loop_else.cfa ${CFACCBIN}
360 ${CFACOMPILE_SYNTAX} -DERR1
361 -cp ${test} ${abspath ${@}}
362
[5715d43]363# Exception Tests
364# Test with libcfathread; it changes how storage works.
365
[e2887a9]366exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
367 ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
368 ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
[5715d43]369
[673eb7a]370# Linking tests
371# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
[e2887a9]372linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
373 ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
374 ${CFACCLINK} -O0 ${@}.o -o ${abspath ${@}}
375 rm ${abspath ${@}}.o
[673eb7a]376
[34e1494]377#------------------------------------------------------------------------------
378# Other targets
Note: See TracBrowser for help on using the repository browser.