Changes in / [b3ce76f:386fb57]


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    rb3ce76f r386fb57  
    1111## Created On       : Sun May 31 22:14:18 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri May 12 18:30:01 2023
    14 ## Update Count     : 42
     13## Last Modified On : Mon May  1 16:38:04 2023
     14## Update Count     : 32
    1515###############################################################################
     16
     17# user targets:
     18#  Compile compiler/runtime and run test suite.
     19#  $ make check / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
     20
     21#  $ make installcheck [debug=yes/no] installed=yes [arch=x86/x64/arm]
    1622
    1723AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     
    2430DIST_SUBDIRS = driver src . libcfa tests
    2531
    26 @LIBCFA_TARGET_MAKEFILES@ : Makefile ${srcdir}/libcfa/configure
    27         @${eval config_file = ${dir ${@}}config.data}
    28         @ls ${config_file} || (echo "Missing config.data, re-run configure script again" && false)
    29         @${eval config_data = ${shell cat ${config_file}}}
    30         @echo "Configuring libcfa (${abs_top_srcdir}/libcfa/configure) with '${config_data}' from ${shell pwd} / ${dir ${@}}"
    31         @cd ${dir ${@}} && ${abs_top_srcdir}/libcfa/configure ${config_data}
     32@LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure
     33        @$(eval config_file = $(dir $@)config.data)
     34        @ls $(config_file) || (echo "Missing config.data, re-run configure script again" && false)
     35        @$(eval config_data = $(shell cat $(config_file)))
     36        @echo "Configuring libcfa ($(abs_top_srcdir)/libcfa/configure) with '$(config_data)' from $(shell pwd) / $(dir $@)"
     37        @cd $(dir $@) && $(abs_top_srcdir)/libcfa/configure $(config_data)
    3238
    3339noinst_DATA = @LIBCFA_TARGET_MAKEFILES@
     
    3945debug ?= yes
    4046installed ?= no
    41 ARCH = ${if ${arch},"arch=${arch}"}
     47ARCH = $(if $(arch),"arch=$(arch)")
    4248
    43 check :
    44         ${MAKE} -C tests tests installed=${installed} debug=${debug} ${ARCH}
     49check:
     50        $(MAKE) -C tests tests installed=$(installed) debug=$(debug) $(ARCH)
    4551
    46 tests : check # synonym
     52tests: check # synonym
    4753
    48 installcheck :
    49         ${MAKE} -C tests tests installed=yes debug=${debug} ${ARCH}
     54installcheck:
     55        $(MAKE) -C tests tests installed=yes debug=$(debug) $(ARCH)
    5056
    51 installtest : installcheck # synonym
    52 
    53 help :
    54         @echo "user targets:"
    55         @echo "    Compile compiler/runtime and run test suite."
    56         @echo "    $$ make check / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]"
    57         @echo ""
    58         @echo "    Compile compiler/runtime, run test suite, and install."
    59         @echo "    $$ make installcheck / installtests [debug=yes/no] installed=yes [arch=x86/x64/arm]"
    60 
    61 configure-libcfa : @LIBCFA_TARGET_MAKEFILES@
     57configure-libcfa: @LIBCFA_TARGET_MAKEFILES@
    6258        @true
    6359
    64 status : @LIBCFA_TARGET_MAKEFILES@
     60status: @LIBCFA_TARGET_MAKEFILES@
    6561        @echo -ne "translator\n\t"
    6662        @./config.status --config | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g"
    6763        @find libcfa -name config.status -printf "\n%h\n\t" -exec {} --config \; | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g"
    6864
    69 @LIBCFA_TARGET_DIRS@ ::
    70         ${MAKE} -C ${@} ${MAKECMDGOALS}
     65@LIBCFA_TARGET_DIRS@::
     66        $(MAKE) -C $@ $(MAKECMDGOALS)
    7167
    72 mostlyclean clean distclean maintainer-clean : @LIBCFA_TARGET_DIRS@
     68mostlyclean clean distclean maintainer-clean: @LIBCFA_TARGET_DIRS@
  • tests/Makefile.am

    rb3ce76f r386fb57  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri May 12 18:03:57 2023
    14 ## Update Count     : 176
     13## Last Modified On : Mon May  1 17:25:24 2023
     14## Update Count     : 145
    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]
    1623
    1724AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     
    2027include $(top_srcdir)/tools/build/cfa.make
    2128
    22 DEFAULT_INCLUDES = -I${abs_srcdir}
     29DEFAULT_INCLUDES = -I$(abs_srcdir)
    2330
    2431debug ?= yes
    2532installed ?= no
    26 ARCH=${if ${arch},"--arch=${arch}"}
     33ARCH=$(if $(arch),"--arch=$(arch)")
    2734archiveerrors=
    2835
     
    3441timeouts=
    3542
    36 TEST_PY = python3 ${builddir}/test.py
     43TEST_PY = python3 $(builddir)/test.py
    3744
    3845# applies to both programs
    3946# since automake doesn't have support for CFA we have to
    40 AM_CFLAGS = ${if ${test}, 2> ${test}, } \
    41         -fdebug-prefix-map=${abspath ${abs_srcdir}}= \
     47AM_CFLAGS = $(if $(test), 2> $(test), ) \
     48        -fdebug-prefix-map=$(abspath $(abs_srcdir))= \
    4249        -fdebug-prefix-map=/tmp= \
    4350        -fno-diagnostics-show-caret \
     
    5259
    5360# get the desired cfa to test
    54 TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@}
     61TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
    5562
    5663# adjust CC to current flags
    57 CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
    58 CFACC = ${CC}
     64CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
     65CFACC = $(CC)
    5966
    6067# get local binary for depedencies
     
    6269
    6370# adjusted CC but without the actual distcc call
    64 CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}}
    65 CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}}
    66 
    67 PRETTY_PATH=mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} &&
    68 
    69 .PHONY : list .validate .test_makeflags
    70 .INTERMEDIATE : .validate .validate.cfa .test_makeflags
     71CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
     72CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g'))
     73
     74PRETTY_PATH=mkdir -p $(dir $(abspath $(@))) && cd $(srcdir) &&
     75
     76.PHONY: list .validate .test_makeflags
     77.INTERMEDIATE: .validate .validate.cfa .test_makeflags
    7178EXTRA_PROGRAMS = avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install
    7279EXTRA_DIST = test.py \
     
    94101dist-hook:
    95102        echo "Gathering test files"
    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}; \
     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}; \
    100107                fi; \
    101108        done
     109
    102110
    103111avl_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
     
    110118
    111119all-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
     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
    113121
    114122install : all-local # PAB only
     
    117125
    118126quick :
    119         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${ARCH} ${quick_test}
    120 
    121 concurrency :
    122         @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCH} -Iconcurrent
     127        @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) $(quick_test)
     128
     129mostlyclean-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)
     134        rm -rf __pycache__
     135
     136distclean-local :
     137        find $(builddir) -path '*.Po' -delete
    123138
    124139list :
    125         @+${TEST_PY} --list ${concurrent}
    126 
    127 help :
    128         @echo "user targets:"
    129         @echo "    Run the complete test suite."
    130         @echo "    $$ make (null) / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]"
    131         @echo ""
    132         @echo "    Run the short (quick) test suite."
    133         @echo "    $$ make quick [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]"
    134         @echo ""
    135         @echo "    Run the concurrent test suite."
    136         @echo "    $$ make concurrency [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]"
    137         @echo ""
    138         @echo "    List all tests in the test suite."
    139         @echo "    $$ make list"
    140 
    141 mostlyclean-local :
    142         find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
    143         find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
    144         find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
    145         rm -f ${EXTRA_PROGRAMS}
    146         rm -rf __pycache__
    147 
    148 distclean-local :
    149         find ${builddir} -path '*.Po' -delete
     140        @+$(TEST_PY) --list $(concurrent)
    150141
    151142.test_makeflags:
    152         @echo "${MAKEFLAGS}"
     143        @echo "$(MAKEFLAGS)"
    153144
    154145.validate: .validate.cfa
    155         ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror
     146        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
    156147
    157148.validate.cfa:
    158         @echo "int main() { return 0; }" > ${@}
     149        @echo "int main() { return 0; }" > $(@)
    159150
    160151# automake doesn't know we still need C rules so pretend like we have a C program
    161152.dummy_hack.c:
    162         @echo "int main() { return 0; }" > ${@}
     153        @echo "int main() { return 0; }" > $(@)
    163154
    164155.dummy_hackxx.cpp:
    165         @echo "int bar() { return 0; }" > ${@}
     156        @echo "int bar() { return 0; }" > $(@)
     157
     158concurrency :
     159        @+$(TEST_PY) --debug=$(debug)  --install=$(installed) -Iconcurrent
    166160
    167161#----------------------------------------------------------------------------------------------------------------
    168162
    169163# Use for all tests, make sure the path are correct and all flags are added
    170 CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}}
     164CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) $($(shell echo "$(@)_FLAGSCFA" | sed 's/-\|\//_/g'))
    171165
    172166#----------------------------------------------------------------------------------------------------------------
     
    175169# split into two steps to support compiling remotely using distcc
    176170# don't use distcc to do the linking because distcc doesn't do linking
    177 % : %.cfa ${CFACCBIN}
    178         ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/"
    179         ${CFACCLINK} ${@}.o -o ${abspath ${@}}
    180         rm ${abspath ${@}}.o
     171% : %.cfa $(CFACCBIN)
     172        $(CFACOMPILETEST) -c -o $(abspath $(@)).o -DIN_DIR="$(abspath $(dir $(<)))/.in/"
     173        $(CFACCLINK) $(@).o -o $(abspath $(@))
     174        rm $(abspath $(@)).o
    181175
    182176# implicit rule for c++ test
    183177# convient for testing the testsuite itself but not actuall used
    184178% : %.cpp
    185         ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}}
     179        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) -o $(abspath $(@))
    186180
    187181#------------------------------------------------------------------------------
     
    194188# Generated code
    195189GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
    196 ${GENERATED_CODE} : % : %.cfa ${CFACCBIN}
    197         ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}}
     190$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
     191        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $(@))
    198192
    199193#------------------------------------------------------------------------------
     
    201195#------------------------------------------------------------------------------
    202196# tests that just validate syntax and compiler output should be compared to stderr
    203 CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
     197CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $(@))
    204198
    205199SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
    206200        init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrent/waitfor/parse
    207 ${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
    208         ${CFACOMPILE_SYNTAX}
    209         ${if ${test}, cp ${test} ${abspath ${@}}, }
     201$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
     202        $(CFACOMPILE_SYNTAX)
     203        $(if $(test), cp $(test) $(abspath $(@)), )
    210204
    211205# expected failures
    212206# use custom target since they require a custom define *and* have a name that doesn't match the file
    213 alloc-ERROR : alloc.cfa ${CFACCBIN}
    214         ${CFACOMPILE_SYNTAX} -DERR1
    215         -cp ${test} ${abspath ${@}}
    216 
    217 init1-ERROR : init1.cfa ${CFACCBIN}
    218         ${CFACOMPILE_SYNTAX} -DERR1
    219         -cp ${test} ${abspath ${@}}
    220 
    221 typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN}
    222         ${CFACOMPILE_SYNTAX} -DERR1
    223         -cp ${test} ${abspath ${@}}
    224 
    225 nested-types-ERR1 : nested-types.cfa ${CFACCBIN}
    226         ${CFACOMPILE_SYNTAX} -DERR1
    227         -cp ${test} ${abspath ${@}}
    228 
    229 nested-types-ERR2 : nested-types.cfa ${CFACCBIN}
    230         ${CFACOMPILE_SYNTAX} -DERR2
    231         -cp ${test} ${abspath ${@}}
    232 
    233 raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN}
    234         ${CFACOMPILE_SYNTAX} -DERR1
    235         -cp ${test} ${abspath ${@}}
    236 
    237 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN}
    238         ${CFACOMPILE_SYNTAX} -DERR1
    239         -cp ${test} ${abspath ${@}}
    240 
    241 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN}
    242         ${CFACOMPILE_SYNTAX} -DERR1
    243         -cp ${test} ${abspath ${@}}
    244 
    245 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN}
    246         ${CFACOMPILE_SYNTAX} -DERR2
    247         -cp ${test} ${abspath ${@}}
     207alloc-ERROR : alloc.cfa $(CFACCBIN)
     208        $(CFACOMPILE_SYNTAX) -DERR1
     209        -cp $(test) $(abspath $(@))
     210
     211init1-ERROR : init1.cfa $(CFACCBIN)
     212        $(CFACOMPILE_SYNTAX) -DERR1
     213        -cp $(test) $(abspath $(@))
     214
     215typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
     216        $(CFACOMPILE_SYNTAX) -DERR1
     217        -cp $(test) $(abspath $(@))
     218
     219nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
     220        $(CFACOMPILE_SYNTAX) -DERR1
     221        -cp $(test) $(abspath $(@))
     222
     223nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
     224        $(CFACOMPILE_SYNTAX) -DERR2
     225        -cp $(test) $(abspath $(@))
     226
     227raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
     228        $(CFACOMPILE_SYNTAX) -DERR1
     229        -cp $(test) $(abspath $(@))
     230
     231raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
     232        $(CFACOMPILE_SYNTAX) -DERR1
     233        -cp $(test) $(abspath $(@))
     234
     235raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
     236        $(CFACOMPILE_SYNTAX) -DERR1
     237        -cp $(test) $(abspath $(@))
     238
     239raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
     240        $(CFACOMPILE_SYNTAX) -DERR2
     241        -cp $(test) $(abspath $(@))
    248242
    249243# Exception Tests
    250244# Test with libcfathread; it changes how storage works.
    251245
    252 exceptions/%-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 ${@}}
     246exceptions/%-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 $(@))
    255249
    256250# Linking tests
    257251# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
    258 linking/linkerror : linking/linkerror.cfa ${CFACCBIN}
    259         ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o
    260         ${CFACCLINK}  -O0 ${@}.o -o ${abspath ${@}}
    261         rm ${abspath ${@}}.o
     252linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
     253        $(CFACOMPILETEST) -O0 -c -o $(abspath $(@)).o
     254        $(CFACCLINK)  -O0 $(@).o -o $(abspath $(@))
     255        rm $(abspath $(@)).o
    262256
    263257#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.