Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    ree0bfa9 rdcfedca  
    2424archiveerrors=
    2525
     26INSTALL_FLAGS=-in-tree
    2627DEBUG_FLAGS=-debug -O0
    2728
     
    3435
    3536# applies to both programs
    36 # since automake doesn't have support for CFA we have to
    3737AM_CFLAGS = $(if $(test), 2> $(test), ) \
    3838        -g \
     
    4242        -DIN_DIR="${abs_srcdir}/.in/"
    4343
    44 # get the desired cfa to test
    45 TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
    46 
    47 # adjust CC to current flags
    48 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    49 CFACC = $(CC)
    50 
    51 # get local binary for depedencies
    52 CFACCBIN = @CFACC@
    53 
    54 # adjusted CC but without the actual distcc call
    55 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     44AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
     45CC = @CFACC@
    5646
    5747PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     
    6757#----------------------------------------------------------------------------------------------------------------
    6858all-local :
    69         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
     59        @+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
    7060
    7161all-tests :
    72         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     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
    7363
    7464clean-local :
     
    9787
    9888# Use for all tests, make sure the path are correct and all flags are added
    99 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
     89CFACOMPILETEST=$(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
     92CFATEST_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
     95CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@})
    10096
    10197#----------------------------------------------------------------------------------------------------------------
    10298
    10399# implicit rule so not all test require a rule
    104 # split into two steps to support compiling remotely using distcc
    105 # don't use distcc to do the linking because distcc doesn't do linking
    106 % : %.cfa $(CFACCBIN)
    107         $(CFACOMPILETEST) -c -o $(abspath ${@}).o
    108         $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
     100% : %.cfa $(CFACC)
     101        $(CFATEST_STDOUT)
    109102
    110 # implicit rule for c++ test
    111 # convient for testing the testsuite itself but not actuall used
    112103% : %.cpp
    113104        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    114105
    115106#------------------------------------------------------------------------------
    116 # TARGETS WITH CUSTOM FLAGS
     107# TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
    117108#------------------------------------------------------------------------------
    118 # custom libs
    119 gmp_FLAGSLD= -lgmp
     109# Expected failures
     110declarationSpecifier_FLAGS= -CFA -XCFA -p
     111gccExtensions_FLAGS= -CFA -XCFA -p
     112extension_FLAGS= -CFA -XCFA -p
     113attributes_FLAGS= -CFA -XCFA -p
     114functions_FLAGS= -CFA -XCFA -p
     115KRfunctions_FLAGS= -CFA -XCFA -p
     116gmp_FLAGS= -lgmp
    120117
    121118#------------------------------------------------------------------------------
    122 # Generated code
    123 GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
    124 $(GENERATED_CODE): % : %.cfa $(CFACCBIN)
    125         $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
    126 
    127 # Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
    128 EXPECT_STDERR = builtins/sync warnings/self-assignment
    129 $(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
    130         $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
     119# Expected failures
     120completeTypeError_FLAGS= -DERR1
    131121
    132122#------------------------------------------------------------------------------
    133123# CUSTOM TARGET
    134124#------------------------------------------------------------------------------
    135 # expected failures
    136 # use custom target since they require a custom define and custom dependencies
    137 alloc-ERROR : alloc.cfa $(CFACCBIN)
    138         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     125typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     126        $(CFATEST_STDOUT) -DERR1
    139127
    140 typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    141         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     128alloc-ERROR: alloc.cfa $(CFACC)
     129        $(CFATEST_STDOUT) -DERR1
    142130
    143 nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    144         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     131nested-types-ERR1: nested-types.cfa $(CFACC)
     132        $(CFATEST_STDOUT) -DERR1
    145133
    146 nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    147         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     134nested-types-ERR2: nested-types.cfa $(CFACC)
     135        $(CFATEST_STDOUT) -DERR2
    148136
    149 raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    150         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     137raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     138        $(CFATEST_STDOUT) -DERR1
    151139
    152 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    153         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     140raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     141        $(CFATEST_STDOUT) -DERR2
    154142
    155 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    156         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     143raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     144        $(CFATEST_STDOUT) -DERR1
    157145
    158 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    159         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     146raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     147        $(CFATEST_STDOUT) -DERR1
    160148
    161 #------------------------------------------------------------------------------
    162 # Other targets
     149#builtins
     150builtins/sync: builtins/sync.cfa $(CFACC)
     151        $(CFATEST_STDERR) -fsyntax-only
     152
     153# Warnings
     154warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
     155        $(CFATEST_STDERR) -fsyntax-only
Note: See TracChangeset for help on using the changeset viewer.