Changeset 933f32f for tests/Makefile.am


Ignore:
Timestamp:
May 24, 2019, 10:19:41 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d908563
Parents:
6a9d4b4 (diff), 292642a (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:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r6a9d4b4 r933f32f  
    2323installed=no
    2424
     25INSTALL_FLAGS=-in-tree
     26DEBUG_FLAGS=-debug -O0
     27
    2528quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
    2629
     
    2831timeouts=
    2932
    30 TEST_PY = python ${builddir}/test.py
     33TEST_PY = python3 ${builddir}/test.py
    3134
    3235# applies to both programs
     
    3639        -Wno-unused-function \
    3740        -quiet @CFA_FLAGS@ \
    38         -DIN_DIR="${srcdir}/.in/"
     41        -DIN_DIR="${abs_srcdir}/.in/"
    3942
    4043AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
    4144CC = @CFACC@
    4245
    43 PRETTY_PATH=cd ${srcdir} &&
     46PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    4447
    4548.PHONY: list .validate
     
    4851
    4952avl_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
    50 # automake doesn't know we still need C rules so pretend like we have a C program
    51 _dummy_hack_SOURCES = .dummy_hack.c
     53# automake doesn't know we still need C/CPP rules so pretend like we have a C program
     54_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
    5255
    5356#----------------------------------------------------------------------------------------------------------------
     
    7477        @echo "int main() { return 0; }" > ${@}
    7578
     79.dummy_hackxx.cpp:
     80        @echo "int bar() { return 0; }" > ${@}
     81
    7682concurrency :
    7783        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     
    7985#----------------------------------------------------------------------------------------------------------------
    8086
     87# Use for all tests, make sure the path are correct and all flags are added
     88CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))
     89
     90# Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail
     91CFATEST_STDOUT=$(CFACOMPILETEST) -o $(abspath ${@})
     92
     93# Use for tests where the make command is expecte to succeed but the expected.txt should be compared to stderr
     94CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@})
     95
     96#----------------------------------------------------------------------------------------------------------------
     97
    8198# implicit rule so not all test require a rule
    8299% : %.cfa $(CFACC)
    83         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     100        $(CFATEST_STDOUT)
    84101
    85 declarationSpecifier: declarationSpecifier.cfa $(CFACC)
    86         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     102% : %.cpp
     103        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    87104
    88 gccExtensions : gccExtensions.cfa $(CFACC)
    89         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     105#------------------------------------------------------------------------------
     106# TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
     107#------------------------------------------------------------------------------
     108# Expected failures
     109declarationSpecifier_FLAGS= -CFA -XCFA -p
     110gccExtensions_FLAGS= -CFA -XCFA -p
     111extension_FLAGS= -CFA -XCFA -p
     112attributes_FLAGS= -CFA -XCFA -p
     113functions_FLAGS= -CFA -XCFA -p
     114KRfunctions_FLAGS= -CFA -XCFA -p
     115gmp_FLAGS= -lgmp
    90116
    91 extension : extension.cfa $(CFACC)
    92         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     117#------------------------------------------------------------------------------
     118# Expected failures
     119completeTypeError_FLAGS= -DERR1
    93120
    94 attributes : attributes.cfa $(CFACC)
    95         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     121#------------------------------------------------------------------------------
     122# CUSTOM TARGET
     123#------------------------------------------------------------------------------
     124typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     125        $(CFATEST_STDOUT) -DERR1
    96126
    97 functions: functions.cfa $(CFACC)
    98         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     127alloc-ERROR: alloc.cfa $(CFACC)
     128        $(CFATEST_STDOUT) -DERR1
    99129
    100 KRfunctions : KRfunctions.cfa $(CFACC)
    101         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     130nested-types-ERR1: nested-types.cfa $(CFACC)
     131        $(CFATEST_STDOUT) -DERR1
    102132
    103 sched-ext-parse : sched-ext-parse.c $(CFACC)
    104         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     133nested-types-ERR2: nested-types.cfa $(CFACC)
     134        $(CFATEST_STDOUT) -DERR2
    105135
    106 gmp : gmp.cfa $(CFACC)
    107         $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     136raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     137        $(CFATEST_STDOUT) -DERR1
     138
     139raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     140        $(CFATEST_STDOUT) -DERR2
     141
     142raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     143        $(CFATEST_STDOUT) -DERR1
     144
     145raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     146        $(CFATEST_STDOUT) -DERR1
    108147
    109148#builtins
    110149builtins/sync: builtins/sync.cfa $(CFACC)
    111         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    112 
    113 #------------------------------------------------------------------------------
    114 
    115 #To make errors path independent we need to cd into the correct directories
    116 completeTypeError : completeTypeError.cfa $(CFACC)
    117         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    118 
    119 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    120         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    121 
    122 alloc-ERROR: alloc.cfa $(CFACC)
    123         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    124 
    125 fallthrough-ERROR: fallthrough.cfa $(CFACC)
    126         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    127 
    128 nested-types-ERR1: nested-types.cfa $(CFACC)
    129         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    130 
    131 nested-types-ERR2: nested-types.cfa $(CFACC)
    132         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    133 
    134 # Constructor/destructor tests
    135 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    136         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    137 
    138 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    139         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    140 
    141 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    142         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    143 
    144 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    145         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     150        $(CFATEST_STDERR) -fsyntax-only
    146151
    147152# Warnings
    148153warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
    149         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     154        $(CFATEST_STDERR) -fsyntax-only
Note: See TracChangeset for help on using the changeset viewer.