source: tests/Makefile.am @ d1566d4

Last change on this file since d1566d4 was 584612d, checked in by Michael Brooks <mlbrooks@…>, 4 weeks ago

Add file missed in d9162ec9

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