Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r386fb57 ra1b41e3  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon May  1 17:25:24 2023
    14 ## Update Count     : 145
     13## Last Modified On : Mon Apr 10 23:24:02 2023
     14## Update Count     : 96
    1515###############################################################################
    16 
    17 # user targets:
    18 #  Run the complete test suite.
    19 #  $ make  / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
    20 
    21 #  Run the short (quick) test suite.
    22 #  $ make quick [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
    2316
    2417AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     
    2720include $(top_srcdir)/tools/build/cfa.make
    2821
    29 DEFAULT_INCLUDES = -I$(abs_srcdir)
    30 
    31 debug ?= yes
    32 installed ?= no
    33 ARCH=$(if $(arch),"--arch=$(arch)")
     22DEFAULT_INCLUDES = -I${abs_srcdir}
     23
     24debug=yes
     25installed=no
    3426archiveerrors=
    3527
     
    4133timeouts=
    4234
    43 TEST_PY = python3 $(builddir)/test.py
     35TEST_PY = python3 ${builddir}/test.py
    4436
    4537# applies to both programs
    4638# since automake doesn't have support for CFA we have to
    4739AM_CFLAGS = $(if $(test), 2> $(test), ) \
    48         -fdebug-prefix-map=$(abspath $(abs_srcdir))= \
     40        -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
    4941        -fdebug-prefix-map=/tmp= \
    5042        -fno-diagnostics-show-caret \
     
    6254
    6355# adjust CC to current flags
    64 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
     56CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    6557CFACC = $(CC)
    6658
     
    6961
    7062# adjusted CC but without the actual distcc call
    71 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
    72 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g'))
    73 
    74 PRETTY_PATH=mkdir -p $(dir $(abspath $(@))) && cd $(srcdir) &&
     63CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     64CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
     65
     66PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    7567
    7668.PHONY: list .validate .test_makeflags
     
    10193dist-hook:
    10294        echo "Gathering test files"
    103         for file in `$(TEST_PY) --list-dist`; do \
    104                 if test -f $(srcdir)/$${file}; then \
    105                         $(MKDIR_P) $$(dirname $(distdir)/$${file}); \
    106                         cp -df $(srcdir)/$${file} $(distdir)/$${file}; \
     95        for file in `${TEST_PY} --list-dist`; do \
     96                if test -f ${srcdir}/$${file}; then \
     97                        $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
     98                        cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
    10799                fi; \
    108100        done
    109 
    110101
    111102avl_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
     
    116107
    117108#----------------------------------------------------------------------------------------------------------------
    118 
    119 all-local : # This name is important to automake and implies the default build target.
    120         @+$(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
    121 
    122 install : all-local # PAB only
    123 
    124 tests : all-local
    125 
    126 quick :
    127         @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) $(quick_test)
     109all-local :
     110        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
     111
     112all-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
    128114
    129115mostlyclean-local :
    130         find $(builddir) -not -path './__pycache__/*' -path '*.o' -delete
    131         find $(builddir) -not -path './__pycache__/*' -path '*/.err/*.log' -delete
    132         find $(builddir) -not -path './__pycache__/*' -path '*/.out/*.log' -delete
    133         rm -f $(EXTRA_PROGRAMS)
     116        find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
     117        find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
     118        find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
     119        rm -f ${EXTRA_PROGRAMS}
    134120        rm -rf __pycache__
    135121
    136122distclean-local :
    137         find $(builddir) -path '*.Po' -delete
     123        find ${builddir} -path '*.Po' -delete
    138124
    139125list :
    140         @+$(TEST_PY) --list $(concurrent)
     126        @+${TEST_PY} --list ${concurrent}
    141127
    142128.test_makeflags:
    143         @echo "$(MAKEFLAGS)"
     129        @echo "${MAKEFLAGS}"
    144130
    145131.validate: .validate.cfa
     
    147133
    148134.validate.cfa:
    149         @echo "int main() { return 0; }" > $(@)
     135        @echo "int main() { return 0; }" > ${@}
    150136
    151137# automake doesn't know we still need C rules so pretend like we have a C program
    152138.dummy_hack.c:
    153         @echo "int main() { return 0; }" > $(@)
     139        @echo "int main() { return 0; }" > ${@}
    154140
    155141.dummy_hackxx.cpp:
    156         @echo "int bar() { return 0; }" > $(@)
     142        @echo "int bar() { return 0; }" > ${@}
    157143
    158144concurrency :
    159         @+$(TEST_PY) --debug=$(debug)  --install=$(installed) -Iconcurrent
     145        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
    160146
    161147#----------------------------------------------------------------------------------------------------------------
    162148
    163149# Use for all tests, make sure the path are correct and all flags are added
    164 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) $($(shell echo "$(@)_FLAGSCFA" | sed 's/-\|\//_/g'))
     150CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
    165151
    166152#----------------------------------------------------------------------------------------------------------------
     
    170156# don't use distcc to do the linking because distcc doesn't do linking
    171157% : %.cfa $(CFACCBIN)
    172         $(CFACOMPILETEST) -c -o $(abspath $(@)).o -DIN_DIR="$(abspath $(dir $(<)))/.in/"
    173         $(CFACCLINK) $(@).o -o $(abspath $(@))
    174         rm $(abspath $(@)).o
     158        $(CFACOMPILETEST) -c -o $(abspath ${@}).o -DIN_DIR="$(abspath $(dir ${<}))/.in/"
     159        $(CFACCLINK) ${@}.o -o $(abspath ${@})
     160        rm $(abspath ${@}).o
    175161
    176162# implicit rule for c++ test
    177163# convient for testing the testsuite itself but not actuall used
    178164% : %.cpp
    179         $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) -o $(abspath $(@))
     165        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    180166
    181167#------------------------------------------------------------------------------
     
    189175GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
    190176$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
    191         $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $(@))
     177        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
    192178
    193179#------------------------------------------------------------------------------
     
    195181#------------------------------------------------------------------------------
    196182# tests that just validate syntax and compiler output should be compared to stderr
    197 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $(@))
     183CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
    198184
    199185SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
     
    201187$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    202188        $(CFACOMPILE_SYNTAX)
    203         $(if $(test), cp $(test) $(abspath $(@)), )
     189        $(if $(test), cp $(test) $(abspath ${@}), )
    204190
    205191# expected failures
     
    207193alloc-ERROR : alloc.cfa $(CFACCBIN)
    208194        $(CFACOMPILE_SYNTAX) -DERR1
    209         -cp $(test) $(abspath $(@))
     195        -cp $(test) $(abspath ${@})
    210196
    211197init1-ERROR : init1.cfa $(CFACCBIN)
    212198        $(CFACOMPILE_SYNTAX) -DERR1
    213         -cp $(test) $(abspath $(@))
     199        -cp $(test) $(abspath ${@})
    214200
    215201typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    216202        $(CFACOMPILE_SYNTAX) -DERR1
    217         -cp $(test) $(abspath $(@))
     203        -cp $(test) $(abspath ${@})
    218204
    219205nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    220206        $(CFACOMPILE_SYNTAX) -DERR1
    221         -cp $(test) $(abspath $(@))
     207        -cp $(test) $(abspath ${@})
    222208
    223209nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    224210        $(CFACOMPILE_SYNTAX) -DERR2
    225         -cp $(test) $(abspath $(@))
     211        -cp $(test) $(abspath ${@})
    226212
    227213raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    228214        $(CFACOMPILE_SYNTAX) -DERR1
    229         -cp $(test) $(abspath $(@))
     215        -cp $(test) $(abspath ${@})
    230216
    231217raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    232218        $(CFACOMPILE_SYNTAX) -DERR1
    233         -cp $(test) $(abspath $(@))
     219        -cp $(test) $(abspath ${@})
    234220
    235221raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    236222        $(CFACOMPILE_SYNTAX) -DERR1
    237         -cp $(test) $(abspath $(@))
     223        -cp $(test) $(abspath ${@})
    238224
    239225raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    240226        $(CFACOMPILE_SYNTAX) -DERR2
    241         -cp $(test) $(abspath $(@))
     227        -cp $(test) $(abspath ${@})
    242228
    243229# Exception Tests
     
    245231
    246232exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
    247         $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath $(@)).o
    248         $(CFACCLOCAL) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath $(@)).o -o $(abspath $(@))
     233        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
     234        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
    249235
    250236# Linking tests
    251237# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
    252238linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
    253         $(CFACOMPILETEST) -O0 -c -o $(abspath $(@)).o
    254         $(CFACCLINK)  -O0 $(@).o -o $(abspath $(@))
    255         rm $(abspath $(@)).o
     239        $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
     240        $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
     241        rm $(abspath ${@}).o
    256242
    257243#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.