source: tests/Makefile.am @ d9162ec

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

Solved the requested warning with exceptions. Also went through the exceptions tests and managed to remove about 2/3rds of them from the lax list that now either didn't have any warnings or warnings because of the test itself.

  • Property mode set to 100644
File size: 16.6 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        alloc \
54        alloc2 \
55        array \
56        array-collections/array-raii-c \
57        array-collections/array-raii-cfa \
58        array-collections/array-sbscr-types \
59        array-collections/boxed \
60                array-collections/boxed% \
61        array-collections/dimexpr-match-c \
62        array-collections/dimexpr-match-cfa \
63        array-ERR1 \
64        array-ERR2 \
65        array-ERR3 \
66        attributes \
67        attr-priority \
68        builtins/sync \
69        cast \
70        collections/atomic_mpsc \
71        collections/queue \
72        collections/sequence \
73        collections/stack \
74        collections/string-api-coverage \
75        collections/string-api-coverage-noshare \
76        collections/vector-demo \
77        concurrency/actors/dynamic \
78        concurrency/actors/executor \
79        concurrency/actors/inherit \
80        concurrency/actors/inline \
81        concurrency/actors/matrixMultiply \
82        concurrency/actors/pingpong \
83        concurrency/actors/poison \
84        concurrency/actors/static \
85        concurrency/actors/types \
86        concurrency/barrier/generation \
87        concurrency/barrier/last \
88        concurrency/barrier/order \
89        concurrency/channels/big_elems \
90        concurrency/channels/churn \
91        concurrency/channels/contend \
92        concurrency/channels/daisy_chain \
93        concurrency/channels/hot_potato \
94        concurrency/channels/ping_pong \
95        concurrency/channels/pub_sub \
96        concurrency/channels/zero_size \
97        concurrency/cluster \
98        concurrency/cofor \
99        concurrency/coroutineYield \
100        concurrency/examples/boundedBufferEXT \
101        concurrency/examples/boundedBufferINT \
102        concurrency/examples/datingService \
103        concurrency/examples/gortn \
104        concurrency/examples/matrixSum \
105        concurrency/examples/quickSort \
106        concurrency/futures/abandon \
107        concurrency/futures/basic \
108        concurrency/futures/multi \
109        concurrency/futures/select_future \
110        concurrency/futures/typed \
111        concurrency/futures/wait_any \
112        concurrency/join \
113        concurrency/lockfree_stack \
114        concurrency/migrate \
115        concurrency/monitor \
116        concurrency/multi-monitor \
117        concurrency/mutexstmt/locks \
118        concurrency/mutexstmt/monitors \
119        concurrency/mutexstmt/tuple \
120        concurrency/once \
121        concurrency/park/contention \
122        concurrency/park/force_preempt \
123        concurrency/park/start_parked \
124        concurrency/preempt \
125        concurrency/preempt2 \
126        concurrency/pthread/bounded_buffer \
127        concurrency/pthread/pthread_attr_test \
128        concurrency/pthread/pthread_cond_test \
129        concurrency/pthread/pthread_demo_create_join \
130        concurrency/pthread/pthread_demo_lock \
131        concurrency/pthread/pthread_key_test \
132        concurrency/pthread/pthread_once_test \
133        concurrency/readyQ/barrier_sleeper \
134        concurrency/readyQ/leader_spin \
135        concurrency/signal/block \
136        concurrency/signal/disjoint \
137        concurrency/signal/wait \
138        concurrency/sleep \
139        concurrency/suspend_then \
140        concurrency/thread \
141        concurrency/unified_locking/block_spin_lock \
142        concurrency/unified_locking/exp_backoff \
143        concurrency/unified_locking/fast_block_lock \
144        concurrency/unified_locking/futex_mutex \
145        concurrency/unified_locking/locks \
146        concurrency/unified_locking/mcs \
147        concurrency/unified_locking/mcs_block_spin_lock \
148        concurrency/unified_locking/mcs_spin \
149        concurrency/unified_locking/pthread_locks \
150        concurrency/unified_locking/simple_owner_lock \
151        concurrency/unified_locking/spin_queue_lock \
152        concurrency/unified_locking/timeout_lock \
153        concurrency/waitfor/barge \
154        concurrency/waitfor/dtor \
155        concurrency/waitfor/parse \
156        concurrency/waitfor/recurse \
157        concurrency/waitfor/statment \
158        concurrency/waitfor/when \
159        concurrency/waituntil/all_types \
160        concurrency/waituntil/basic_else \
161        concurrency/waituntil/channel_close \
162        concurrency/waituntil/channel_zero_size \
163        concurrency/waituntil/channels \
164        concurrency/waituntil/futures \
165        concurrency/waituntil/locks \
166        concurrency/waituntil/one_chan \
167        concurrency/waituntil/repeat_close \
168        concurrency/waituntil/timeout \
169        configs/parsebools \
170        configs/parsenums \
171        configs/usage \
172        coroutine/devicedriver \
173        coroutine/fibonacci \
174        coroutine/fmtLines \
175        coroutine/pingpong \
176        coroutine/prodcons \
177        coroutine/raii \
178        coroutine/runningTotal \
179        ctrl-flow/goto \
180        ctrl-flow/ifwhileCtl \
181        ctrl-flow/labelledExit \
182        ctrl-flow/loop_else \
183        designations \
184        enum \
185        enum_tests/inc-dec \
186        enum_tests/planet \
187        enum_tests/structEnum \
188        exceptions/cardgame \
189        exceptions/defaults \
190        exceptions/defaults-threads \
191        exceptions/hotpotato \
192        exceptions/hotpotato_checked \
193        exceptions/pingpong_nonlocal \
194        exceptions/polymorphic \
195        exceptions/try-leave-catch \
196        exceptions/virtual-poly \
197        expression \
198        forall \
199        function-operator \
200        gmp \
201        heap \
202        identFuncDeclarator \
203        identParamDeclarator \
204        include/includes \
205        include/stdincludes \
206        include/vector-collections \
207        include/vector-fstream \
208        include/vector-sequence \
209        init1 \
210        init1-ERROR \
211        io/away_fair \
212        io/comp_basic \
213        io/comp_fair \
214        io/io-acquire \
215        io/io-acquire2 \
216        io/io-acquire-in \
217        io/io-acquire-no-io \
218        io/io-acquire-out \
219        io/manipulatorsInput \
220        io/manipulatorsInput-uchunk \
221        io/many_read \
222        limits \
223        linking/io-acquire \
224        linking/mangling/anon \
225                linking/mangling/lib.o \
226                linking/mangling/main.o \
227        linking/withthreads \
228        linkonce \
229                link-once/% \
230        malloc \
231        math \
232        mathX \
233        maybe \
234        minmax \
235        nested_function \
236        nested-types \
237        nested-types-ERR1 \
238        nested-types-ERR2 \
239        numericConstants \
240        operators \
241        poly-d-cycle \
242        poly-many-arsz \
243        poly-member \
244        polymorphism \
245        poly-o-cycle \
246        PRNG \
247        quasiKeyword \
248        quotedKeyword \
249        raii/boxed-types \
250        raii/ctor-autogen \
251        raii/dtor-early-exit \
252        raii/init_once \
253        raii/partial \
254        rational \
255        references \
256        result \
257        shortCircuit \
258        sizeof \
259        smart-pointers \
260        sum \
261        switch \
262        tuple/tupleAssign \
263        tuple/tupleCast \
264        tuple/tupleMember \
265        tuple/tuplePolymorphism \
266        tuple/tupleVariadic \
267        typedefRedef \
268        typedefRedef-ERR1 \
269        typeof \
270        variableDeclarator \
271        vector \
272        warnings/self-assignment
273
274WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
275
276# applies to both programs
277# since automake doesn't have support for CFA we have to
278AM_CFLAGS = ${if ${test}, 2> ${test}, } \
279        -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
280        -fdebug-prefix-map=/tmp= \
281        -fno-diagnostics-show-caret \
282        -g \
283        $(WFLAGS) \
284        -quiet @CFA_FLAGS@
285
286AM_CFAFLAGS = -XCFA --deterministic-out
287
288# get the desired cfa to test
289TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
290
291# adjust CC to current flags
292CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
293CFACC = ${CC}
294
295# get local binary for depedencies
296CFACCBIN = @CFACC@
297
298# adjusted CC but without the actual distcc call
299CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
300CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
301
302PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
303
304.PHONY : concurrency list .validate .test_makeflags
305.INTERMEDIATE : .validate .validate.cfa .test_makeflags
306EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
307EXTRA_DIST = test.py \
308        pybin/__init__.py \
309        pybin/print-core.gdb \
310        pybin/settings.py \
311        pybin/test_run.py \
312        pybin/tools.py \
313        long_tests.hfa \
314        array-collections/boxed.hfa \
315        array-collections/boxed.cases.hfa \
316        avltree/avl-private.h \
317        avltree/avl.h \
318        exceptions/except-io.hfa \
319        exceptions/with-threads.hfa \
320        meta/fork+exec.hfa \
321        concurrency/clib_tls.c \
322        concurrency/clib.c \
323        concurrency/unified_locking/mutex_test.hfa \
324        concurrency/channels/parallel_harness.hfa \
325        array-collections/dimexpr-match.hfa \
326        array-collections/dimexpr-match-detail.sh \
327        array-collections/array-raii.hfa
328
329dist-hook:
330        echo "Gathering test files"
331        for file in `${TEST_PY} --list-dist`; do \
332                if ls ${srcdir}/$${file} > /dev/null 2>&1; then \
333                        ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
334                        cp -df ${srcdir}/$${file} $$(dirname ${distdir}/$${file}); \
335                fi; \
336        done
337
338array_collections_boxed_SOURCES = array-collections/boxed.main.cfa array-collections/boxed.bookend.cfa
339avl_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
340linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
341linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa
342# automake doesn't know we still need C/CPP rules so pretend like we have a C program
343nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
344
345#----------------------------------------------------------------------------------------------------------------
346
347# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
348all-local : # This name is important to automake and implies the default build target.
349        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all
350
351tests : all-local # synonym
352
353install : all-local  # synonym, PAB only
354
355quick :
356        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test}
357
358concurrency :
359        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency
360
361list :
362        @+${TEST_PY} --list
363
364help :
365        @echo "user targets:"
366        @echo "    Run the complete test suite."
367        @echo "    $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
368        @echo ""
369        @echo "    Run the short (quick) test suite."
370        @echo "    $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]"
371        @echo ""
372        @echo "    Run the concurrency test suite."
373        @echo "    $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
374        @echo ""
375        @echo "    List all tests in the test suite."
376        @echo "    $$ make list"
377
378mostlyclean-local :
379        find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
380        find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
381        find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
382        rm -f ${EXTRA_PROGRAMS}
383        rm -rf __pycache__
384
385distclean-local :
386        find ${builddir} -path '*.Po' -delete
387
388.test_makeflags:
389        @echo "${MAKEFLAGS}"
390
391.validate: .validate.cfa
392        ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
393
394.validate.cfa:
395        @echo "int main() { return 0; }" > ${@}
396
397# automake doesn't know we still need C rules so pretend like we have a C program
398.dummy_hack.c:
399        @echo "int main() { return 0; }" > ${@}
400
401.dummy_hackxx.cpp:
402        @echo "int bar() { return 0; }" > ${@}
403
404#----------------------------------------------------------------------------------------------------------------
405
406# Use for all tests, make sure the path are correct and all flags are added
407CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
408
409#----------------------------------------------------------------------------------------------------------------
410
411# implicit rule so not all test require a rule
412# split into two steps to support compiling remotely using distcc
413# don't use distcc to do the linking because distcc doesn't do linking
414% : %.cfa ${CFACCBIN}
415        ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
416        ${CFACCLINK} ${@}.o -o ${abspath ${@}}
417        rm ${abspath ${@}}.o
418
419# implicit rule for c++ test
420# convient for testing the testsuite itself but not actuall used
421% : %.cpp
422        ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
423
424#------------------------------------------------------------------------------
425# TARGETS WITH CUSTOM FLAGS
426#------------------------------------------------------------------------------
427# custom libs
428gmp_FLAGSLD= -lgmp
429
430#------------------------------------------------------------------------------
431# Generated code
432GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
433${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
434        ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
435
436#------------------------------------------------------------------------------
437# CUSTOM TARGET
438#------------------------------------------------------------------------------
439# tests that just validate syntax and compiler output should be compared to stderr
440CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
441
442SYNTAX_ONLY_CODE = \
443        array cast expression identFuncDeclarator init1 limits nested-types numericConstants opt-params quasiKeyword switch typedefRedef variableDeclarator \
444        builtins/sync concurrency/waitfor/parse ctrl-flow/labelledExit include/stdincludes include/includes warnings/self-assignment
445
446${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
447        ${CFACOMPILE_SYNTAX}
448        ${if ${test}, cp ${test} ${abspath ${@}}, }
449
450# expected failures
451# use custom target since they require a custom define *and* have a name that doesn't match the file
452
453array-ERR1 : array.cfa ${CFACCBIN}
454        ${CFACOMPILE_SYNTAX} -DERR1
455        -cp ${test} ${abspath ${@}}
456
457array-ERR2 : array.cfa ${CFACCBIN}
458        ${CFACOMPILE_SYNTAX} -DERR2
459        -cp ${test} ${abspath ${@}}
460
461array-ERR3 : array.cfa ${CFACCBIN}
462        ${CFACOMPILE_SYNTAX} -DERR3
463        -cp ${test} ${abspath ${@}}
464
465array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa
466        ${CFACOMPILE_SYNTAX} -DERRS
467        -cp ${test} ${abspath ${@}}
468
469array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa
470        ${CFACOMPILE_SYNTAX} -DERRS
471        -cp ${test} ${abspath ${@}}
472
473alloc-ERROR : alloc.cfa ${CFACCBIN}
474        ${CFACOMPILE_SYNTAX} -DERR1
475        -cp ${test} ${abspath ${@}}
476
477init1-ERROR : init1.cfa ${CFACCBIN}
478        ${CFACOMPILE_SYNTAX} -DERR1
479        -cp ${test} ${abspath ${@}}
480
481typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
482        ${CFACOMPILE_SYNTAX} -DERR1
483        -cp ${test} ${abspath ${@}}
484
485nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
486        ${CFACOMPILE_SYNTAX} -DERR1
487        -cp ${test} ${abspath ${@}}
488
489nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
490        ${CFACOMPILE_SYNTAX} -DERR2
491        -cp ${test} ${abspath ${@}}
492
493raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
494        ${CFACOMPILE_SYNTAX} -DERR1
495        -cp ${test} ${abspath ${@}}
496
497raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
498        ${CFACOMPILE_SYNTAX} -DERR1
499        -cp ${test} ${abspath ${@}}
500
501raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
502        ${CFACOMPILE_SYNTAX} -DERR1
503        -cp ${test} ${abspath ${@}}
504
505raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
506        ${CFACOMPILE_SYNTAX} -DERR2
507        -cp ${test} ${abspath ${@}}
508
509raii/partial-ERR1 : raii/partial.cfa ${CFACCBIN}
510        ${CFACOMPILE_SYNTAX} -DERR1
511        -cp ${test} ${abspath ${@}}
512
513# Exception Tests
514# Test with libcfathread; it changes how storage works.
515
516exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
517        ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
518        ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
519
520# Linking tests
521# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
522linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
523        ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
524        ${CFACCLINK}  -O0 ${@}.o -o ${abspath ${@}}
525        rm ${abspath ${@}}.o
526
527#------------------------------------------------------------------------------
528# Other targets
Note: See TracBrowser for help on using the repository browser.