Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    rdcfedca re3a5a73  
    2222debug=yes
    2323installed=no
    24 archiveerrors=
    2524
    2625INSTALL_FLAGS=-in-tree
     
    4544CC = @CFACC@
    4645
    47 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     46PRETTY_PATH=cd ${srcdir} &&
    4847
    4948.PHONY: list .validate
     
    5756#----------------------------------------------------------------------------------------------------------------
    5857all-local :
    59         @+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
     58        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} ${quick_test}
    6059
    6160all-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
     61        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    6362
    6463clean-local :
     
    8685#----------------------------------------------------------------------------------------------------------------
    8786
    88 # 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 ${@})
    96 
    97 #----------------------------------------------------------------------------------------------------------------
    98 
    9987# implicit rule so not all test require a rule
    10088% : %.cfa $(CFACC)
    101         $(CFATEST_STDOUT)
     89        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    10290
    10391% : %.cpp
    10492        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    10593
    106 #------------------------------------------------------------------------------
    107 # TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
    108 #------------------------------------------------------------------------------
    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
     94declarationSpecifier: declarationSpecifier.cfa $(CFACC)
     95        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    11796
    118 #------------------------------------------------------------------------------
    119 # Expected failures
    120 completeTypeError_FLAGS= -DERR1
     97gccExtensions : gccExtensions.cfa $(CFACC)
     98        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    12199
    122 #------------------------------------------------------------------------------
    123 # CUSTOM TARGET
    124 #------------------------------------------------------------------------------
    125 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    126         $(CFATEST_STDOUT) -DERR1
     100extension : extension.cfa $(CFACC)
     101        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    127102
    128 alloc-ERROR: alloc.cfa $(CFACC)
    129         $(CFATEST_STDOUT) -DERR1
     103attributes : attributes.cfa $(CFACC)
     104        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    130105
    131 nested-types-ERR1: nested-types.cfa $(CFACC)
    132         $(CFATEST_STDOUT) -DERR1
     106functions: functions.cfa $(CFACC)
     107        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    133108
    134 nested-types-ERR2: nested-types.cfa $(CFACC)
    135         $(CFATEST_STDOUT) -DERR2
     109KRfunctions : KRfunctions.cfa $(CFACC)
     110        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    136111
    137 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    138         $(CFATEST_STDOUT) -DERR1
     112sched-ext-parse : sched-ext-parse.c $(CFACC)
     113        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    139114
    140 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    141         $(CFATEST_STDOUT) -DERR2
    142 
    143 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    144         $(CFATEST_STDOUT) -DERR1
    145 
    146 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    147         $(CFATEST_STDOUT) -DERR1
     115gmp : gmp.cfa $(CFACC)
     116        $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    148117
    149118#builtins
    150119builtins/sync: builtins/sync.cfa $(CFACC)
    151         $(CFATEST_STDERR) -fsyntax-only
     120        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     121
     122#------------------------------------------------------------------------------
     123
     124#To make errors path independent we need to cd into the correct directories
     125completeTypeError : completeTypeError.cfa $(CFACC)
     126        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     127
     128typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     129        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     130
     131alloc-ERROR: alloc.cfa $(CFACC)
     132        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     133
     134fallthrough-ERROR: fallthrough.cfa $(CFACC)
     135        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     136
     137nested-types-ERR1: nested-types.cfa $(CFACC)
     138        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     139
     140nested-types-ERR2: nested-types.cfa $(CFACC)
     141        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     142
     143# Constructor/destructor tests
     144raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     145        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     146
     147raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     148        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     149
     150raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     151        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     152
     153raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     154        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    152155
    153156# Warnings
    154157warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
    155         $(CFATEST_STDERR) -fsyntax-only
     158        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
Note: See TracChangeset for help on using the changeset viewer.