Changeset 044ae62 for tests/Makefile.am


Ignore:
Timestamp:
May 29, 2023, 11:44:29 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT
Children:
fa2c005
Parents:
3a513d89 (diff), 2b78949 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ADT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r3a513d89 r044ae62  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Apr 10 23:24:02 2023
    14 ## Update Count     : 96
     13## Last Modified On : Tue May 16 09:27:48 2023
     14## Update Count     : 178
    1515###############################################################################
    1616
     
    2222DEFAULT_INCLUDES = -I${abs_srcdir}
    2323
    24 debug=yes
    25 installed=no
     24debug ?= yes
     25installed ?= no
     26ARCH = ${if ${arch},"--arch=${arch}"}
     27arch_support = "x86/x64/arm"
     28DEBUG_FLAGS = -debug -g -O0
     29
     30quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes meta/dumpable
     31
    2632archiveerrors=
    27 
    28 DEBUG_FLAGS=-debug -g -O0
    29 
    30 quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes meta/dumpable
    31 
    3233concurrent=
    3334timeouts=
     
    3738# applies to both programs
    3839# since automake doesn't have support for CFA we have to
    39 AM_CFLAGS = $(if $(test), 2> $(test), ) \
    40         -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
     40AM_CFLAGS = ${if ${test}, 2> ${test}, } \
     41        -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
    4142        -fdebug-prefix-map=/tmp= \
    4243        -fno-diagnostics-show-caret \
     
    5152
    5253# get the desired cfa to test
    53 TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
     54TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
    5455
    5556# adjust CC to current flags
    56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    57 CFACC = $(CC)
     57CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
     58CFACC = ${CC}
    5859
    5960# get local binary for depedencies
     
    6162
    6263# adjusted CC but without the actual distcc call
    63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    64 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
    65 
    66 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    67 
    68 .PHONY: list .validate .test_makeflags
    69 .INTERMEDIATE: .validate .validate.cfa .test_makeflags
     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'}}
     66
     67PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
     68
     69.PHONY : list .validate .test_makeflags
     70.INTERMEDIATE : .validate .validate.cfa .test_makeflags
    7071EXTRA_PROGRAMS = avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
    7172EXTRA_DIST = test.py \
     
    9596        for file in `${TEST_PY} --list-dist`; do \
    9697                if test -f ${srcdir}/$${file}; then \
    97                         $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
     98                        ${MKDIR_P} $$(dirname ${distdir}/$${file}); \
    9899                        cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
    99100                fi; \
     
    107108
    108109#----------------------------------------------------------------------------------------------------------------
    109 all-local :
    110         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
    111 
    112 all-tests :
    113         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     110
     111all-local : # This name is important to automake and implies the default build target.
     112        @+${TEST_PY} --debug=${debug} --install=${installed} --invariant --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${ARCH} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     113
     114install : all-local # PAB only
     115
     116tests : all-local
     117
     118quick :
     119        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${ARCH} ${quick_test}
     120
     121concurrency :
     122        @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCH} -Iconcurrent
     123
     124list :
     125        @+${TEST_PY} --list ${concurrent}
     126
     127help :
     128        @echo "user targets:"
     129        @echo "    Run the complete test suite."
     130        @echo "    $$ make (null) / tests [debug=yes/no] [installed=yes/no] [arch=${arch_support}]"
     131        @echo ""
     132        @echo "    Run the short (quick) test suite."
     133        @echo "    $$ make quick [debug=yes/no] [installed=yes/no] [arch=${arch_support}]"
     134        @echo ""
     135        @echo "    Run the concurrent test suite."
     136        @echo "    $$ make concurrency [debug=yes/no] [installed=yes/no] [arch=${arch_support}]"
     137        @echo ""
     138        @echo "    List all tests in the test suite."
     139        @echo "    $$ make list"
    114140
    115141mostlyclean-local :
     
    123149        find ${builddir} -path '*.Po' -delete
    124150
    125 list :
    126         @+${TEST_PY} --list ${concurrent}
    127 
    128151.test_makeflags:
    129152        @echo "${MAKEFLAGS}"
    130153
    131154.validate: .validate.cfa
    132         $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
     155        ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
    133156
    134157.validate.cfa:
     
    142165        @echo "int bar() { return 0; }" > ${@}
    143166
    144 concurrency :
    145         @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
    146 
    147167#----------------------------------------------------------------------------------------------------------------
    148168
    149169# Use for all tests, make sure the path are correct and all flags are added
    150 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
     170CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
    151171
    152172#----------------------------------------------------------------------------------------------------------------
     
    155175# split into two steps to support compiling remotely using distcc
    156176# don't use distcc to do the linking because distcc doesn't do linking
    157 % : %.cfa $(CFACCBIN)
    158         $(CFACOMPILETEST) -c -o $(abspath ${@}).o -DIN_DIR="$(abspath $(dir ${<}))/.in/"
    159         $(CFACCLINK) ${@}.o -o $(abspath ${@})
    160         rm $(abspath ${@}).o
     177% : %.cfa ${CFACCBIN}
     178        ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
     179        ${CFACCLINK} ${@}.o -o ${abspath ${@}}
     180        rm ${abspath ${@}}.o
    161181
    162182# implicit rule for c++ test
    163183# convient for testing the testsuite itself but not actuall used
    164184% : %.cpp
    165         $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     185        ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
    166186
    167187#------------------------------------------------------------------------------
     
    174194# Generated code
    175195GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
    176 $(GENERATED_CODE): % : %.cfa $(CFACCBIN)
    177         $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
     196${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
     197        ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
    178198
    179199#------------------------------------------------------------------------------
     
    181201#------------------------------------------------------------------------------
    182202# tests that just validate syntax and compiler output should be compared to stderr
    183 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
     203CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
    184204
    185205SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
    186206        init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrent/waitfor/parse
    187 $(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    188         $(CFACOMPILE_SYNTAX)
    189         $(if $(test), cp $(test) $(abspath ${@}), )
     207${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
     208        ${CFACOMPILE_SYNTAX}
     209        ${if ${test}, cp ${test} ${abspath ${@}}, }
    190210
    191211# expected failures
    192212# use custom target since they require a custom define *and* have a name that doesn't match the file
    193 alloc-ERROR : alloc.cfa $(CFACCBIN)
    194         $(CFACOMPILE_SYNTAX) -DERR1
    195         -cp $(test) $(abspath ${@})
    196 
    197 init1-ERROR : init1.cfa $(CFACCBIN)
    198         $(CFACOMPILE_SYNTAX) -DERR1
    199         -cp $(test) $(abspath ${@})
    200 
    201 typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    202         $(CFACOMPILE_SYNTAX) -DERR1
    203         -cp $(test) $(abspath ${@})
    204 
    205 nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    206         $(CFACOMPILE_SYNTAX) -DERR1
    207         -cp $(test) $(abspath ${@})
    208 
    209 nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    210         $(CFACOMPILE_SYNTAX) -DERR2
    211         -cp $(test) $(abspath ${@})
    212 
    213 raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    214         $(CFACOMPILE_SYNTAX) -DERR1
    215         -cp $(test) $(abspath ${@})
    216 
    217 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    218         $(CFACOMPILE_SYNTAX) -DERR1
    219         -cp $(test) $(abspath ${@})
    220 
    221 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    222         $(CFACOMPILE_SYNTAX) -DERR1
    223         -cp $(test) $(abspath ${@})
    224 
    225 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    226         $(CFACOMPILE_SYNTAX) -DERR2
    227         -cp $(test) $(abspath ${@})
     213alloc-ERROR : alloc.cfa ${CFACCBIN}
     214        ${CFACOMPILE_SYNTAX} -DERR1
     215        -cp ${test} ${abspath ${@}}
     216
     217init1-ERROR : init1.cfa ${CFACCBIN}
     218        ${CFACOMPILE_SYNTAX} -DERR1
     219        -cp ${test} ${abspath ${@}}
     220
     221typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
     222        ${CFACOMPILE_SYNTAX} -DERR1
     223        -cp ${test} ${abspath ${@}}
     224
     225nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
     226        ${CFACOMPILE_SYNTAX} -DERR1
     227        -cp ${test} ${abspath ${@}}
     228
     229nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
     230        ${CFACOMPILE_SYNTAX} -DERR2
     231        -cp ${test} ${abspath ${@}}
     232
     233raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
     234        ${CFACOMPILE_SYNTAX} -DERR1
     235        -cp ${test} ${abspath ${@}}
     236
     237raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
     238        ${CFACOMPILE_SYNTAX} -DERR1
     239        -cp ${test} ${abspath ${@}}
     240
     241raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
     242        ${CFACOMPILE_SYNTAX} -DERR1
     243        -cp ${test} ${abspath ${@}}
     244
     245raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
     246        ${CFACOMPILE_SYNTAX} -DERR2
     247        -cp ${test} ${abspath ${@}}
    228248
    229249# Exception Tests
    230250# Test with libcfathread; it changes how storage works.
    231251
    232 exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
    233         $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
    234         $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
     252exceptions/%-threads : exceptions/%.cfa ${CFACCBIN}
     253        ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o
     254        ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}}
    235255
    236256# Linking tests
    237257# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
    238 linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
    239         $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
    240         $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
    241         rm $(abspath ${@}).o
     258linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
     259        ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
     260        ${CFACCLINK}  -O0 ${@}.o -o ${abspath ${@}}
     261        rm ${abspath ${@}}.o
    242262
    243263#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.