Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r655c5fa r34e1494  
    3535
    3636# applies to both programs
     37# since automake doesn't have support for CFA we have to
    3738AM_CFLAGS = $(if $(test), 2> $(test), ) \
    3839        -g \
     
    4243        -DIN_DIR="${abs_srcdir}/.in/"
    4344
    44 AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
    45 CC = @CFACC@
     45# adjust CC to current flags
     46CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     47CFACC = $(CC)
     48
     49# get local binary for depedencies
     50CFACCBIN = @CFACC@
     51
     52# adjusted CC but without the actual distcc call
     53CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
    4654
    4755PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     
    5765#----------------------------------------------------------------------------------------------------------------
    5866all-local :
    59         @+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
     67        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
    6068
    6169all-tests :
    62         @+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     70        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    6371
    6472clean-local :
     
    8795
    8896# Use for all tests, make sure the path are correct and all flags are added
    89 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))
    90 
    91 # Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail
    92 CFATEST_STDOUT=$(CFACOMPILETEST) -o $(abspath ${@})
    93 
    94 # Use for tests where the make command is expecte to succeed but the expected.txt should be compared to stderr
    95 CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@})
     97CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
    9698
    9799#----------------------------------------------------------------------------------------------------------------
    98100
    99101# implicit rule so not all test require a rule
    100 % : %.cfa $(CFACC)
    101         $(CFATEST_STDOUT)
     102# split into two steps to support compiling remotely using distcc
     103# don't use distcc to do the linking because distcc doesn't do linking
     104% : %.cfa $(CFACCBIN)
     105        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
     106        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
    102107
     108# implicit rule for c++ test
     109# convient for testing the testsuite itself but not actuall used
    103110% : %.cpp
    104111        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    105112
    106113#------------------------------------------------------------------------------
    107 # TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
     114# TARGETS WITH CUSTOM FLAGS
    108115#------------------------------------------------------------------------------
    109 # Expected failures
    110 declarationSpecifier_FLAGS= -CFA -XCFA -p
    111 gccExtensions_FLAGS= -CFA -XCFA -p
    112 extension_FLAGS= -CFA -XCFA -p
    113 attributes_FLAGS= -CFA -XCFA -p
    114 functions_FLAGS= -CFA -XCFA -p
    115 KRfunctions_FLAGS= -CFA -XCFA -p
    116 gmp_FLAGS= -lgmp
     116# custom libs
     117gmp_FLAGSLD= -lgmp
    117118
    118119#------------------------------------------------------------------------------
    119 # Expected failures
    120 completeTypeError_FLAGS= -DERR1
     120# Generated code
     121GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
     122$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
     123        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
     124
     125# Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
     126EXPECT_STDERR = builtins/sync warnings/self-assignment
     127$(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
     128        $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
    121129
    122130#------------------------------------------------------------------------------
    123131# CUSTOM TARGET
    124132#------------------------------------------------------------------------------
    125 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    126         $(CFATEST_STDOUT) -DERR1
     133# expected failures
     134# use custom target since they require a custom define and custom dependencies
     135alloc-ERROR : alloc.cfa $(CFACCBIN)
     136        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    127137
    128 alloc-ERROR: alloc.cfa $(CFACC)
    129         $(CFATEST_STDOUT) -DERR1
     138typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
     139        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    130140
    131 nested-types-ERR1: nested-types.cfa $(CFACC)
    132         $(CFATEST_STDOUT) -DERR1
     141nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
     142        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    133143
    134 nested-types-ERR2: nested-types.cfa $(CFACC)
    135         $(CFATEST_STDOUT) -DERR2
     144nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
     145        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
    136146
    137 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    138         $(CFATEST_STDOUT) -DERR1
     147raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
     148        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    139149
    140 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    141         $(CFATEST_STDOUT) -DERR2
     150raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
     151        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    142152
    143 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    144         $(CFATEST_STDOUT) -DERR1
     153raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
     154        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    145155
    146 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    147         $(CFATEST_STDOUT) -DERR1
     156raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
     157        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
    148158
    149 #builtins
    150 builtins/sync: builtins/sync.cfa $(CFACC)
    151         $(CFATEST_STDERR) -fsyntax-only
    152 
    153 # Warnings
    154 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
    155         $(CFATEST_STDERR) -fsyntax-only
     159#------------------------------------------------------------------------------
     160# Other targets
Note: See TracChangeset for help on using the changeset viewer.