source: tests/Makefile.am @ 70d8e2f2

Last change on this file since 70d8e2f2 was 0f4ac10, checked in by Michael Brooks <mlbrooks@…>, 13 months ago

Add tests demonstrating CFA's treatment of C arrays, compared with GCC's.

These tests recognize two levels of CFA functionality: Classic and Preview. This commit shows that CFA Master implements Classic. Preview refers to Mike's forthcoming changes.

Only the CFA part runs in the nightly build. Under CFA Classic, a limitation is that only some rejection cases are exercised in the nightly build. A hand-driven testing script can access all the cases and CFA Preview will exercise all the cases in the nightly build.

test dimexpr-match-c: how CFA's treatment of C arrays compares with GCC's

test dimexpr-match-cfa: how CFA's treamtment of <containers/array.hfa>-arrays aligns with the above

  • Property mode set to 100644
File size: 10.4 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
[5007618]13## Last Modified On : Sun May 28 08:15:43 2023
14## Update Count     : 196
[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
[ef7d253]38# applies to both programs
[d65f92c]39# since automake doesn't have support for CFA we have to
[e2887a9]40AM_CFLAGS = ${if ${test}, 2> ${test}, } \
41        -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
[87fc1b4]42        -fdebug-prefix-map=/tmp= \
[0a19c51]43        -fno-diagnostics-show-caret \
[b8f6002]44        -g \
45        -Wall \
[850aff1]46        -Werror=return-type \
[b8f6002]47        -Wno-unused-function \
[36fbaeca]48        -Wno-psabi \
[b44959f]49        -quiet @CFA_FLAGS@
[7c03d6d]50
[7215000]51AM_CFAFLAGS = -XCFA --deterministic-out
52
[158b026]53# get the desired cfa to test
[e2887a9]54TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
[158b026]55
[34e1494]56# adjust CC to current flags
[e2887a9]57CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
58CFACC = ${CC}
[ef7d253]59
[34e1494]60# get local binary for depedencies
61CFACCBIN = @CFACC@
62
63# adjusted CC but without the actual distcc call
[e2887a9]64CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
65CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
[34e1494]66
[e3d4fd1]67PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
[f7d3215]68
[bdbf536]69.PHONY : concurrency list .validate .test_makeflags
[e2887a9]70.INTERMEDIATE : .validate .validate.cfa .test_makeflags
[258aaab8]71EXTRA_PROGRAMS = avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
[a468e1e9]72EXTRA_DIST = test.py \
73        pybin/__init__.py \
74        pybin/print-core.gdb \
75        pybin/settings.py \
76        pybin/test_run.py \
77        pybin/tools.py \
78        long_tests.hfa \
[d0fa494]79        avltree/avl-private.h \
80        avltree/avl.h \
[d0a00a5a]81        configs/.in/parseconfig-all.txt \
82        configs/.in/parseconfig-errors.txt \
83        configs/.in/parseconfig-missing.txt \
[d0fa494]84        exceptions/except-io.hfa \
85        exceptions/with-threads.hfa \
[b44959f]86        io/.in/io.data \
[3bd5ca7]87        io/.in/many_read.data \
[d0fa494]88        meta/fork+exec.hfa \
[c26bea2a]89        concurrency/clib_tls.c \
90        concurrency/clib.c \
91        concurrency/unified_locking/mutex_test.hfa \
[6b1c4f2]92        concurrency/channels/parallel_harness.hfa
[a468e1e9]93
94dist-hook:
95        echo "Gathering test files"
[e2887a9]96        for file in `${TEST_PY} --list-dist`; do \
97                if test -f ${srcdir}/$${file}; then \
98                        ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
99                        cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
[a468e1e9]100                fi; \
101        done
[44f44617]102
[107b01a]103avl_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]104linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
[258aaab8]105linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa
[2b10f95]106# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]107nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]108
[73abe95]109#----------------------------------------------------------------------------------------------------------------
[4daf79f]110
[5007618]111# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
[c083c3d]112all-local : # This name is important to automake and implies the default build target.
[d144c26]113        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all
[4daf79f]114
[5007618]115tests : all-local # synonym
[4daf79f]116
[5007618]117install : all-local  # synonym, PAB only
[df42128]118
[4daf79f]119quick :
[5007618]120        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test}
[e2887a9]121
122concurrency :
[5007618]123        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency
[e2887a9]124
125list :
[bdbf536]126        @+${TEST_PY} --list
[e2887a9]127
128help :
129        @echo "user targets:"
130        @echo "    Run the complete test suite."
[5007618]131        @echo "    $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
[e2887a9]132        @echo ""
133        @echo "    Run the short (quick) test suite."
[5007618]134        @echo "    $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]"
[e2887a9]135        @echo ""
[bdbf536]136        @echo "    Run the concurrency test suite."
[5007618]137        @echo "    $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]"
[e2887a9]138        @echo ""
139        @echo "    List all tests in the test suite."
140        @echo "    $$ make list"
[927e9ce]141
[2a59655]142mostlyclean-local :
[e2887a9]143        find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
144        find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
145        find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
146        rm -f ${EXTRA_PROGRAMS}
[2a59655]147        rm -rf __pycache__
148
149distclean-local :
[e2887a9]150        find ${builddir} -path '*.Po' -delete
[927e9ce]151
[fc01219]152.test_makeflags:
[e2887a9]153        @echo "${MAKEFLAGS}"
[fc01219]154
[1e995d6]155.validate: .validate.cfa
[e2887a9]156        ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
[1e995d6]157
158.validate.cfa:
[e2887a9]159        @echo "int main() { return 0; }" > ${@}
[28582b2]160
[107b01a]161# automake doesn't know we still need C rules so pretend like we have a C program
162.dummy_hack.c:
[e2887a9]163        @echo "int main() { return 0; }" > ${@}
[28582b2]164
[2b10f95]165.dummy_hackxx.cpp:
[e2887a9]166        @echo "int bar() { return 0; }" > ${@}
[026a0f5]167
[73abe95]168#----------------------------------------------------------------------------------------------------------------
[dc8511c]169
[e16797c]170# Use for all tests, make sure the path are correct and all flags are added
[e2887a9]171CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
[d9b499c]172
[e16797c]173#----------------------------------------------------------------------------------------------------------------
[a843067]174
[e16797c]175# implicit rule so not all test require a rule
[15f9c8e]176# split into two steps to support compiling remotely using distcc
[34e1494]177# don't use distcc to do the linking because distcc doesn't do linking
[e2887a9]178% : %.cfa ${CFACCBIN}
179        ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
180        ${CFACCLINK} ${@}.o -o ${abspath ${@}}
181        rm ${abspath ${@}}.o
[f7d3215]182
[34e1494]183# implicit rule for c++ test
184# convient for testing the testsuite itself but not actuall used
[e16797c]185% : %.cpp
[e2887a9]186        ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
[4c8f86b3]187
[f7d3215]188#------------------------------------------------------------------------------
[34e1494]189# TARGETS WITH CUSTOM FLAGS
[e16797c]190#------------------------------------------------------------------------------
[34e1494]191# custom libs
192gmp_FLAGSLD= -lgmp
[dc8511c]193
[e16797c]194#------------------------------------------------------------------------------
[34e1494]195# Generated code
196GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
[e2887a9]197${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
198        ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
[34e1494]199
[e16797c]200#------------------------------------------------------------------------------
201# CUSTOM TARGET
202#------------------------------------------------------------------------------
[66812dd]203# tests that just validate syntax and compiler output should be compared to stderr
[e2887a9]204CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
[40c81e5]205
[35d1de5]206SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
[c26bea2a]207        init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrency/waitfor/parse
[e2887a9]208${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
209        ${CFACOMPILE_SYNTAX}
210        ${if ${test}, cp ${test} ${abspath ${@}}, }
[87fc1b4]211
[34e1494]212# expected failures
[e6cfb4e2]213# use custom target since they require a custom define *and* have a name that doesn't match the file
[a5aa5bf]214
215array-ERR1 : array.cfa ${CFACCBIN}
216        ${CFACOMPILE_SYNTAX} -DERR1
217        -cp ${test} ${abspath ${@}}
218
219array-ERR2 : array.cfa ${CFACCBIN}
220        ${CFACOMPILE_SYNTAX} -DERR2
221        -cp ${test} ${abspath ${@}}
222
223array-ERR3 : array.cfa ${CFACCBIN}
224        ${CFACOMPILE_SYNTAX} -DERR3
225        -cp ${test} ${abspath ${@}}
226
[0f4ac10]227array-container/dimexpr-match-c-ERRS : array-container/dimexpr-match-c.cfa
228        ${CFACOMPILE_SYNTAX} -DERRS
229        -cp ${test} ${abspath ${@}}
230
231array-container/dimexpr-match-cfa-ERRS : array-container/dimexpr-match-cfa.cfa
232        ${CFACOMPILE_SYNTAX} -DERRS
233        -cp ${test} ${abspath ${@}}
234
[e2887a9]235alloc-ERROR : alloc.cfa ${CFACCBIN}
236        ${CFACOMPILE_SYNTAX} -DERR1
237        -cp ${test} ${abspath ${@}}
[b93a3de]238
[e2887a9]239init1-ERROR : init1.cfa ${CFACCBIN}
240        ${CFACOMPILE_SYNTAX} -DERR1
241        -cp ${test} ${abspath ${@}}
[ee858bf]242
[e2887a9]243typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
244        ${CFACOMPILE_SYNTAX} -DERR1
245        -cp ${test} ${abspath ${@}}
[e2c70ab]246
[e2887a9]247nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
248        ${CFACOMPILE_SYNTAX} -DERR1
249        -cp ${test} ${abspath ${@}}
[49e1275]250
[e2887a9]251nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
252        ${CFACOMPILE_SYNTAX} -DERR2
253        -cp ${test} ${abspath ${@}}
[49e1275]254
[e2887a9]255raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
256        ${CFACOMPILE_SYNTAX} -DERR1
257        -cp ${test} ${abspath ${@}}
[cdbfab0]258
[e2887a9]259raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
260        ${CFACOMPILE_SYNTAX} -DERR1
261        -cp ${test} ${abspath ${@}}
[80e8582]262
[e2887a9]263raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
264        ${CFACOMPILE_SYNTAX} -DERR1
265        -cp ${test} ${abspath ${@}}
[80e8582]266
[e2887a9]267raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
268        ${CFACOMPILE_SYNTAX} -DERR2
269        -cp ${test} ${abspath ${@}}
[e16797c]270
[5715d43]271# Exception Tests
272# Test with libcfathread; it changes how storage works.
273
[e2887a9]274exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
275        ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
276        ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
[5715d43]277
[673eb7a]278# Linking tests
279# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
[e2887a9]280linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
281        ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
282        ${CFACCLINK}  -O0 ${@}.o -o ${abspath ${@}}
283        rm ${abspath ${@}}.o
[673eb7a]284
[34e1494]285#------------------------------------------------------------------------------
286# Other targets
Note: See TracBrowser for help on using the repository browser.