source: tests/Makefile.am @ 77148b0

Last change on this file since 77148b0 was 956ad355, checked in by Peter A. Buhr <pabuhr@…>, 5 weeks ago

remove fixed tests from WFLGAS_OPT_LAX

  • Property mode set to 100644
File size: 17.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        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/cancel/coroutine \
189        exceptions/cancel/thread \
190        exceptions/cardgame \
191        exceptions/conditional \
192        exceptions/conditional-threads \
193        exceptions/cor_resumer \
194        exceptions/data-except \
195        exceptions/defaults \
196        exceptions/defaults-threads \
197        exceptions/fibonacci_nonlocal \
198        exceptions/finally \
199        exceptions/finally-threads \
200        exceptions/hotpotato \
201        exceptions/hotpotato_checked \
202        exceptions/interact \
203        exceptions/pingpong_nonlocal \
204        exceptions/polymorphic \
205        exceptions/resume \
206        exceptions/resume-threads \
207        exceptions/terminate \
208        exceptions/terminate-threads \
209        exceptions/trash \
210        exceptions/try-leave-catch \
211        exceptions/virtual-cast \
212        exceptions/virtual-poly \
213        expression \
214        forall \
215        function-operator \
216        gmp \
217        heap \
218        identFuncDeclarator \
219        identParamDeclarator \
220        include/includes \
221        include/stdincludes \
222        include/vector-collections \
223        include/vector-fstream \
224        include/vector-sequence \
225        init1 \
226        init1-ERROR \
227        io/away_fair \
228        io/comp_basic \
229        io/comp_fair \
230        io/io-acquire \
231        io/io-acquire2 \
232        io/io-acquire-in \
233        io/io-acquire-no-io \
234        io/io-acquire-out \
235        io/manipulatorsInput \
236        io/manipulatorsInput-uchunk \
237        io/many_read \
238        limits \
239        linking/io-acquire \
240        linking/mangling/anon \
241                linking/mangling/lib.o \
242                linking/mangling/main.o \
243        linking/withthreads \
244        linkonce \
245                link-once/% \
246        malloc \
247        math \
248        mathX \
249        maybe \
250        minmax \
251        nested_function \
252        nested-types \
253        nested-types-ERR1 \
254        nested-types-ERR2 \
255        numericConstants \
256        operators \
257        poly-d-cycle \
258        poly-many-arsz \
259        poly-member \
260        polymorphism \
261        poly-o-cycle \
262        PRNG \
263        quasiKeyword \
264        quotedKeyword \
265        raii/boxed-types \
266        raii/ctor-autogen \
267        raii/dtor-early-exit \
268        raii/init_once \
269        raii/partial \
270        rational \
271        references \
272        result \
273        shortCircuit \
274        sizeof \
275        smart-pointers \
276        sum \
277        switch \
278        tuple/tupleAssign \
279        tuple/tupleCast \
280        tuple/tupleMember \
281        tuple/tuplePolymorphism \
282        tuple/tupleVariadic \
283        typedefRedef \
284        typedefRedef-ERR1 \
285        typeof \
286        variableDeclarator \
287        vector \
288        warnings/self-assignment
289
290WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
291
292# applies to both programs
293# since automake doesn't have support for CFA we have to
294AM_CFLAGS = ${if ${test}, 2> ${test}, } \
295        -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
296        -fdebug-prefix-map=/tmp= \
297        -fno-diagnostics-show-caret \
298        -g \
299        $(WFLAGS) \
300        -quiet @CFA_FLAGS@
301
302AM_CFAFLAGS = -XCFA --deterministic-out
303
304# get the desired cfa to test
305TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
306
307# adjust CC to current flags
308CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
309CFACC = ${CC}
310
311# get local binary for depedencies
312CFACCBIN = @CFACC@
313
314# adjusted CC but without the actual distcc call
315CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
316CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
317
318PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
319
320.PHONY : concurrency list .validate .test_makeflags
321.INTERMEDIATE : .validate .validate.cfa .test_makeflags
322EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
323EXTRA_DIST = test.py \
324        pybin/__init__.py \
325        pybin/print-core.gdb \
326        pybin/settings.py \
327        pybin/test_run.py \
328        pybin/tools.py \
329        long_tests.hfa \
330        array-collections/boxed.hfa \
331        array-collections/boxed.cases.hfa \
332        avltree/avl-private.h \
333        avltree/avl.h \
334        exceptions/except-io.hfa \
335        exceptions/with-threads.hfa \
336        meta/fork+exec.hfa \
337        concurrency/clib_tls.c \
338        concurrency/clib.c \
339        concurrency/unified_locking/mutex_test.hfa \
340        concurrency/channels/parallel_harness.hfa \
341        array-collections/dimexpr-match.hfa \
342        array-collections/dimexpr-match-detail.sh \
343        array-collections/array-raii.hfa
344
345dist-hook:
346        echo "Gathering test files"
347        for file in `${TEST_PY} --list-dist`; do \
348                if ls ${srcdir}/$${file} > /dev/null 2>&1; then \
349                        ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
350                        cp -df ${srcdir}/$${file} $$(dirname ${distdir}/$${file}); \
351                fi; \
352        done
353
354array_collections_boxed_SOURCES = array-collections/boxed.main.cfa array-collections/boxed.bookend.cfa
355avl_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
356linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
357linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa
358# automake doesn't know we still need C/CPP rules so pretend like we have a C program
359nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
360
361#----------------------------------------------------------------------------------------------------------------
362
363# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
364all-local : # This name is important to automake and implies the default build target.
365        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all
366
367tests : all-local # synonym
368
369install : all-local  # synonym, PAB only
370
371quick :
372        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test}
373
374concurrency :
375        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency
376
377list :
378        @+${TEST_PY} --list
379
380help :
381        @echo "user targets:"
382        @echo "    Run the complete test suite."
383        @echo "    $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
384        @echo ""
385        @echo "    Run the short (quick) test suite."
386        @echo "    $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]"
387        @echo ""
388        @echo "    Run the concurrency test suite."
389        @echo "    $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
390        @echo ""
391        @echo "    List all tests in the test suite."
392        @echo "    $$ make list"
393
394mostlyclean-local :
395        find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
396        find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
397        find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
398        rm -f ${EXTRA_PROGRAMS}
399        rm -rf __pycache__
400
401distclean-local :
402        find ${builddir} -path '*.Po' -delete
403
404.test_makeflags:
405        @echo "${MAKEFLAGS}"
406
407.validate: .validate.cfa
408        ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
409
410.validate.cfa:
411        @echo "int main() { return 0; }" > ${@}
412
413# automake doesn't know we still need C rules so pretend like we have a C program
414.dummy_hack.c:
415        @echo "int main() { return 0; }" > ${@}
416
417.dummy_hackxx.cpp:
418        @echo "int bar() { return 0; }" > ${@}
419
420#----------------------------------------------------------------------------------------------------------------
421
422# Use for all tests, make sure the path are correct and all flags are added
423CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
424
425#----------------------------------------------------------------------------------------------------------------
426
427# implicit rule so not all test require a rule
428# split into two steps to support compiling remotely using distcc
429# don't use distcc to do the linking because distcc doesn't do linking
430% : %.cfa ${CFACCBIN}
431        ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
432        ${CFACCLINK} ${@}.o -o ${abspath ${@}}
433        rm ${abspath ${@}}.o
434
435# implicit rule for c++ test
436# convient for testing the testsuite itself but not actuall used
437% : %.cpp
438        ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
439
440#------------------------------------------------------------------------------
441# TARGETS WITH CUSTOM FLAGS
442#------------------------------------------------------------------------------
443# custom libs
444gmp_FLAGSLD= -lgmp
445
446#------------------------------------------------------------------------------
447# Generated code
448GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
449${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
450        ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
451
452#------------------------------------------------------------------------------
453# CUSTOM TARGET
454#------------------------------------------------------------------------------
455# tests that just validate syntax and compiler output should be compared to stderr
456CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
457
458SYNTAX_ONLY_CODE = \
459        array cast expression identFuncDeclarator init1 limits nested-types numericConstants opt-params quasiKeyword switch typedefRedef variableDeclarator \
460        builtins/sync concurrency/waitfor/parse ctrl-flow/labelledExit include/stdincludes include/includes warnings/self-assignment
461
462${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
463        ${CFACOMPILE_SYNTAX}
464        ${if ${test}, cp ${test} ${abspath ${@}}, }
465
466# expected failures
467# use custom target since they require a custom define *and* have a name that doesn't match the file
468
469array-ERR1 : array.cfa ${CFACCBIN}
470        ${CFACOMPILE_SYNTAX} -DERR1
471        -cp ${test} ${abspath ${@}}
472
473array-ERR2 : array.cfa ${CFACCBIN}
474        ${CFACOMPILE_SYNTAX} -DERR2
475        -cp ${test} ${abspath ${@}}
476
477array-ERR3 : array.cfa ${CFACCBIN}
478        ${CFACOMPILE_SYNTAX} -DERR3
479        -cp ${test} ${abspath ${@}}
480
481array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa
482        ${CFACOMPILE_SYNTAX} -DERRS
483        -cp ${test} ${abspath ${@}}
484
485array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa
486        ${CFACOMPILE_SYNTAX} -DERRS
487        -cp ${test} ${abspath ${@}}
488
489alloc-ERROR : alloc.cfa ${CFACCBIN}
490        ${CFACOMPILE_SYNTAX} -DERR1
491        -cp ${test} ${abspath ${@}}
492
493init1-ERROR : init1.cfa ${CFACCBIN}
494        ${CFACOMPILE_SYNTAX} -DERR1
495        -cp ${test} ${abspath ${@}}
496
497typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
498        ${CFACOMPILE_SYNTAX} -DERR1
499        -cp ${test} ${abspath ${@}}
500
501nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
502        ${CFACOMPILE_SYNTAX} -DERR1
503        -cp ${test} ${abspath ${@}}
504
505nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
506        ${CFACOMPILE_SYNTAX} -DERR2
507        -cp ${test} ${abspath ${@}}
508
509raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
510        ${CFACOMPILE_SYNTAX} -DERR1
511        -cp ${test} ${abspath ${@}}
512
513raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
514        ${CFACOMPILE_SYNTAX} -DERR1
515        -cp ${test} ${abspath ${@}}
516
517raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
518        ${CFACOMPILE_SYNTAX} -DERR1
519        -cp ${test} ${abspath ${@}}
520
521raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
522        ${CFACOMPILE_SYNTAX} -DERR2
523        -cp ${test} ${abspath ${@}}
524
525raii/partial-ERR1 : raii/partial.cfa ${CFACCBIN}
526        ${CFACOMPILE_SYNTAX} -DERR1
527        -cp ${test} ${abspath ${@}}
528
529# Exception Tests
530# Test with libcfathread; it changes how storage works.
531
532exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
533        ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
534        ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
535
536# Linking tests
537# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
538linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
539        ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
540        ${CFACCLINK}  -O0 ${@}.o -o ${abspath ${@}}
541        rm ${abspath ${@}}.o
542
543#------------------------------------------------------------------------------
544# Other targets
Note: See TracBrowser for help on using the repository browser.