source: tests/Makefile.am @ d923fca

Last change on this file since d923fca was d923fca, checked in by Andrew Beach <ajbeach@…>, 6 weeks ago

Clean-up the warnings of the concurrency tests. A lot of little test level fixes, the most interesting repeated one is some formally redundent fallthough statements. pthread_attr_test had to be rewritten because of library restrictions. Changed some types so they would always be pointer sized. There was a library change, there was a function that could not be implemented; I trust that it is included for a reason so I just put it in a comment. There is a change to the compiler, wait-until now uses goto. The labelled breaks were code generated as unlabelled breaks and although it worked out slipped through some checks. Finally, there is one warning that I cannot solve at this time so tests that produce it have been put in their own lax group.

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