Changeset 3d5701e for tests/Makefile.am


Ignore:
Timestamp:
Feb 25, 2020, 1:17:33 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7dc2e015
Parents:
9fb8f01 (diff), dd9e1ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r9fb8f01 r3d5701e  
    2424archiveerrors=
    2525
    26 INSTALL_FLAGS=-in-tree
    2726DEBUG_FLAGS=-debug -O0
    2827
     
    3534
    3635# 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 AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
    45 CC = @CFACC@
     44# get the desired cfa to test
     45TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
     46
     47# adjust CC to current flags
     48CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     49CFACC = $(CC)
     50
     51# get local binary for depedencies
     52CFACCBIN = @CFACC@
     53
     54# adjusted CC but without the actual distcc call
     55CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    4656
    4757PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     
    5767#----------------------------------------------------------------------------------------------------------------
    5868all-local :
    59         @+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
     69        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
    6070
    6171all-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
     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
    6373
    6474clean-local :
     
    8797
    8898# 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 ${@})
     99CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
    96100
    97101#----------------------------------------------------------------------------------------------------------------
    98102
    99103# implicit rule so not all test require a rule
    100 % : %.cfa $(CFACC)
    101         $(CFATEST_STDOUT)
     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 ${@})
    102109
     110# implicit rule for c++ test
     111# convient for testing the testsuite itself but not actuall used
    103112% : %.cpp
    104113        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    105114
    106115#------------------------------------------------------------------------------
    107 # TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
     116# TARGETS WITH CUSTOM FLAGS
    108117#------------------------------------------------------------------------------
    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
     118# custom libs
     119gmp_FLAGSLD= -lgmp
    117120
    118121#------------------------------------------------------------------------------
    119 # Expected failures
    120 completeTypeError_FLAGS= -DERR1
     122# Generated code
     123GENERATED_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
     128EXPECT_STDERR = builtins/sync warnings/self-assignment
     129$(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
     130        $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
    121131
    122132#------------------------------------------------------------------------------
    123133# CUSTOM TARGET
    124134#------------------------------------------------------------------------------
    125 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    126         $(CFATEST_STDOUT) -DERR1
     135# expected failures
     136# use custom target since they require a custom define and custom dependencies
     137alloc-ERROR : alloc.cfa $(CFACCBIN)
     138        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    127139
    128 alloc-ERROR: alloc.cfa $(CFACC)
    129         $(CFATEST_STDOUT) -DERR1
     140typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
     141        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    130142
    131 nested-types-ERR1: nested-types.cfa $(CFACC)
    132         $(CFATEST_STDOUT) -DERR1
     143nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
     144        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    133145
    134 nested-types-ERR2: nested-types.cfa $(CFACC)
    135         $(CFATEST_STDOUT) -DERR2
     146nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
     147        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
    136148
    137 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    138         $(CFATEST_STDOUT) -DERR1
     149raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
     150        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    139151
    140 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    141         $(CFATEST_STDOUT) -DERR2
     152raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
     153        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    142154
    143 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    144         $(CFATEST_STDOUT) -DERR1
     155raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
     156        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
    145157
    146 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    147         $(CFATEST_STDOUT) -DERR1
     158raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
     159        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
    148160
    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
     161#------------------------------------------------------------------------------
     162# Other targets
Note: See TracChangeset for help on using the changeset viewer.