source: tests/Makefile.am@ 53f4b55

Last change on this file since 53f4b55 was a8e2215, checked in by Michael Brooks <mlbrooks@…>, 9 months ago

Tidy vector-iterator POC and remedy its warnings

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