Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r34e1494 r655c5fa  
    3535
    3636# applies to both programs
    37 # since automake doesn't have support for CFA we have to
    3837AM_CFLAGS = $(if $(test), 2> $(test), ) \
    3938        -g \
     
    4342        -DIN_DIR="${abs_srcdir}/.in/"
    4443
    45 # adjust CC to current flags
    46 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
    47 CFACC = $(CC)
    48 
    49 # get local binary for depedencies
    50 CFACCBIN = @CFACC@
    51 
    52 # adjusted CC but without the actual distcc call
    53 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     44AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
     45CC = @CFACC@
    5446
    5547PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     
    6557#----------------------------------------------------------------------------------------------------------------
    6658all-local :
    67         @+${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}
    6860
    6961all-tests :
    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
     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
    7163
    7264clean-local :
     
    9587
    9688# Use for all tests, make sure the path are correct and all flags are added
    97 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 ${@})
    9896
    9997#----------------------------------------------------------------------------------------------------------------
    10098
    10199# implicit rule so not all test require a rule
    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 ${@})
     100% : %.cfa $(CFACC)
     101        $(CFATEST_STDOUT)
    107102
    108 # implicit rule for c++ test
    109 # convient for testing the testsuite itself but not actuall used
    110103% : %.cpp
    111104        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    112105
    113106#------------------------------------------------------------------------------
    114 # TARGETS WITH CUSTOM FLAGS
     107# TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
    115108#------------------------------------------------------------------------------
    116 # custom libs
    117 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
    118117
    119118#------------------------------------------------------------------------------
    120 # Generated code
    121 GENERATED_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
    126 EXPECT_STDERR = builtins/sync warnings/self-assignment
    127 $(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
    128         $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
     119# Expected failures
     120completeTypeError_FLAGS= -DERR1
    129121
    130122#------------------------------------------------------------------------------
    131123# CUSTOM TARGET
    132124#------------------------------------------------------------------------------
    133 # expected failures
    134 # use custom target since they require a custom define and custom dependencies
    135 alloc-ERROR : alloc.cfa $(CFACCBIN)
    136         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     125typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     126        $(CFATEST_STDOUT) -DERR1
    137127
    138 typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    139         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     128alloc-ERROR: alloc.cfa $(CFACC)
     129        $(CFATEST_STDOUT) -DERR1
    140130
    141 nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    142         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     131nested-types-ERR1: nested-types.cfa $(CFACC)
     132        $(CFATEST_STDOUT) -DERR1
    143133
    144 nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    145         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     134nested-types-ERR2: nested-types.cfa $(CFACC)
     135        $(CFATEST_STDOUT) -DERR2
    146136
    147 raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    148         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     137raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     138        $(CFATEST_STDOUT) -DERR1
    149139
    150 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    151         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     140raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     141        $(CFATEST_STDOUT) -DERR2
    152142
    153 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    154         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     143raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     144        $(CFATEST_STDOUT) -DERR1
    155145
    156 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    157         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     146raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     147        $(CFATEST_STDOUT) -DERR1
    158148
    159 #------------------------------------------------------------------------------
    160 # 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.