Changeset 4daf79f for tests/Makefile.am
- Timestamp:
- May 1, 2023, 4:59:07 PM (12 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c083c3d
- Parents:
- 985b624
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/Makefile.am
r985b624 r4daf79f 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Apr 10 23:24:02202314 ## Update Count : 9613 ## Last Modified On : Mon May 1 16:45:07 2023 14 ## Update Count : 144 15 15 ############################################################################### 16 17 # user targets: 18 # Run the complete test suite. 19 # $ make / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm] 20 # 21 # Run the short (quick) test suite. 22 # $ make quick [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm] 16 23 17 24 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names … … 20 27 include $(top_srcdir)/tools/build/cfa.make 21 28 22 DEFAULT_INCLUDES = -I${abs_srcdir} 23 24 debug=yes 25 installed=no 29 DEFAULT_INCLUDES = -I$(abs_srcdir) 30 31 debug ?= yes 32 installed ?= no 33 ARCH=$(if $(arch),"--arch=$(arch)") 26 34 archiveerrors= 27 35 … … 33 41 timeouts= 34 42 35 TEST_PY = python3 $ {builddir}/test.py43 TEST_PY = python3 $(builddir)/test.py 36 44 37 45 # applies to both programs 38 46 # since automake doesn't have support for CFA we have to 39 47 AM_CFLAGS = $(if $(test), 2> $(test), ) \ 40 -fdebug-prefix-map=$(abspath $ {abs_srcdir})= \48 -fdebug-prefix-map=$(abspath $(abs_srcdir))= \ 41 49 -fdebug-prefix-map=/tmp= \ 42 50 -fno-diagnostics-show-caret \ … … 54 62 55 63 # adjust CC to current flags 56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $ {ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})64 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS)) 57 65 CFACC = $(CC) 58 66 … … 61 69 62 70 # adjusted CC but without the actual distcc call 63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) $ {ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})64 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "$ {@}_FLAGSLD" | sed 's/-\|\//_/g'))65 66 PRETTY_PATH=mkdir -p $(dir $(abspath $ {@})) && cd ${srcdir}&&71 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS)) 72 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g')) 73 74 PRETTY_PATH=mkdir -p $(dir $(abspath $(@))) && cd $(srcdir) && 67 75 68 76 .PHONY: list .validate .test_makeflags … … 93 101 dist-hook: 94 102 echo "Gathering test files" 95 for file in `$ {TEST_PY}--list-dist`; do \96 if test -f $ {srcdir}/$${file}; then \97 $(MKDIR_P) $$(dirname $ {distdir}/$${file}); \98 cp -df $ {srcdir}/$${file} ${distdir}/$${file}; \103 for file in `$(TEST_PY) --list-dist`; do \ 104 if test -f $(srcdir)/$$(file); then \ 105 $(MKDIR_P) $$(dirname $(distdir)/$$(file)); \ 106 cp -df $(srcdir)/$$(file) $(distdir)/$$(file); \ 99 107 fi; \ 100 108 done … … 107 115 108 116 #---------------------------------------------------------------------------------------------------------------- 117 109 118 all-local : 110 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test} 111 112 all-tests : 113 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 119 @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 120 121 install : all-local # PAB only 122 123 tests : all-local 124 125 quick : 126 @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) $(quick_test) 114 127 115 128 mostlyclean-local : 116 find $ {builddir}-not -path './__pycache__/*' -path '*.o' -delete117 find $ {builddir}-not -path './__pycache__/*' -path '*/.err/*.log' -delete118 find $ {builddir}-not -path './__pycache__/*' -path '*/.out/*.log' -delete119 rm -f $ {EXTRA_PROGRAMS}129 find $(builddir) -not -path './__pycache__/*' -path '*.o' -delete 130 find $(builddir) -not -path './__pycache__/*' -path '*/.err/*.log' -delete 131 find $(builddir) -not -path './__pycache__/*' -path '*/.out/*.log' -delete 132 rm -f $(EXTRA_PROGRAMS) 120 133 rm -rf __pycache__ 121 134 122 135 distclean-local : 123 find $ {builddir}-path '*.Po' -delete136 find $(builddir) -path '*.Po' -delete 124 137 125 138 list : 126 @+$ {TEST_PY} --list ${concurrent}139 @+$(TEST_PY) --list $(concurrent) 127 140 128 141 .test_makeflags: 129 @echo "$ {MAKEFLAGS}"142 @echo "$(MAKEFLAGS)" 130 143 131 144 .validate: .validate.cfa … … 133 146 134 147 .validate.cfa: 135 @echo "int main() { return 0; }" > $ {@}148 @echo "int main() { return 0; }" > $(@) 136 149 137 150 # automake doesn't know we still need C rules so pretend like we have a C program 138 151 .dummy_hack.c: 139 @echo "int main() { return 0; }" > $ {@}152 @echo "int main() { return 0; }" > $(@) 140 153 141 154 .dummy_hackxx.cpp: 142 @echo "int bar() { return 0; }" > $ {@}155 @echo "int bar() { return 0; }" > $(@) 143 156 144 157 concurrency : 145 @+$ {TEST_PY} --debug=${debug} --install=${installed}-Iconcurrent158 @+$(TEST_PY) --debug=$(debug) --install=$(installed) -Iconcurrent 146 159 147 160 #---------------------------------------------------------------------------------------------------------------- 148 161 149 162 # Use for all tests, make sure the path are correct and all flags are added 150 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$ {srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))163 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) $($(shell echo "$(@)_FLAGSCFA" | sed 's/-\|\//_/g')) 151 164 152 165 #---------------------------------------------------------------------------------------------------------------- … … 156 169 # don't use distcc to do the linking because distcc doesn't do linking 157 170 % : %.cfa $(CFACCBIN) 158 $(CFACOMPILETEST) -c -o $(abspath $ {@}).o -DIN_DIR="$(abspath $(dir ${<}))/.in/"159 $(CFACCLINK) $ {@}.o -o $(abspath ${@})160 rm $(abspath $ {@}).o171 $(CFACOMPILETEST) -c -o $(abspath $(@)).o -DIN_DIR="$(abspath $(dir $(<)))/.in/" 172 $(CFACCLINK) $(@).o -o $(abspath $(@)) 173 rm $(abspath $(@)).o 161 174 162 175 # implicit rule for c++ test 163 176 # convient for testing the testsuite itself but not actuall used 164 177 % : %.cpp 165 $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$ {srcdir} ${<}) -o $(abspath ${@})178 $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) -o $(abspath $(@)) 166 179 167 180 #------------------------------------------------------------------------------ … … 175 188 GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions 176 189 $(GENERATED_CODE): % : %.cfa $(CFACCBIN) 177 $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $ {@})190 $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $(@)) 178 191 179 192 #------------------------------------------------------------------------------ … … 181 194 #------------------------------------------------------------------------------ 182 195 # tests that just validate syntax and compiler output should be compared to stderr 183 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $ {@})196 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $(@)) 184 197 185 198 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \ … … 187 200 $(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN) 188 201 $(CFACOMPILE_SYNTAX) 189 $(if $(test), cp $(test) $(abspath $ {@}), )202 $(if $(test), cp $(test) $(abspath $(@)), ) 190 203 191 204 # expected failures … … 193 206 alloc-ERROR : alloc.cfa $(CFACCBIN) 194 207 $(CFACOMPILE_SYNTAX) -DERR1 195 -cp $(test) $(abspath $ {@})208 -cp $(test) $(abspath $(@)) 196 209 197 210 init1-ERROR : init1.cfa $(CFACCBIN) 198 211 $(CFACOMPILE_SYNTAX) -DERR1 199 -cp $(test) $(abspath $ {@})212 -cp $(test) $(abspath $(@)) 200 213 201 214 typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN) 202 215 $(CFACOMPILE_SYNTAX) -DERR1 203 -cp $(test) $(abspath $ {@})216 -cp $(test) $(abspath $(@)) 204 217 205 218 nested-types-ERR1 : nested-types.cfa $(CFACCBIN) 206 219 $(CFACOMPILE_SYNTAX) -DERR1 207 -cp $(test) $(abspath $ {@})220 -cp $(test) $(abspath $(@)) 208 221 209 222 nested-types-ERR2 : nested-types.cfa $(CFACCBIN) 210 223 $(CFACOMPILE_SYNTAX) -DERR2 211 -cp $(test) $(abspath $ {@})224 -cp $(test) $(abspath $(@)) 212 225 213 226 raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN) 214 227 $(CFACOMPILE_SYNTAX) -DERR1 215 -cp $(test) $(abspath $ {@})228 -cp $(test) $(abspath $(@)) 216 229 217 230 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN) 218 231 $(CFACOMPILE_SYNTAX) -DERR1 219 -cp $(test) $(abspath $ {@})232 -cp $(test) $(abspath $(@)) 220 233 221 234 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN) 222 235 $(CFACOMPILE_SYNTAX) -DERR1 223 -cp $(test) $(abspath $ {@})236 -cp $(test) $(abspath $(@)) 224 237 225 238 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN) 226 239 $(CFACOMPILE_SYNTAX) -DERR2 227 -cp $(test) $(abspath $ {@})240 -cp $(test) $(abspath $(@)) 228 241 229 242 # Exception Tests … … 231 244 232 245 exceptions/%-threads : exceptions/%.cfa $(CFACCBIN) 233 $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath $ {@}).o234 $(CFACCLOCAL) $($(shell echo "$ {@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})246 $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath $(@)).o 247 $(CFACCLOCAL) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath $(@)).o -o $(abspath $(@)) 235 248 236 249 # Linking tests 237 250 # Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls) 238 251 linking/linkerror : linking/linkerror.cfa $(CFACCBIN) 239 $(CFACOMPILETEST) -O0 -c -o $(abspath $ {@}).o240 $(CFACCLINK) -O0 $ {@}.o -o $(abspath ${@})241 rm $(abspath $ {@}).o252 $(CFACOMPILETEST) -O0 -c -o $(abspath $(@)).o 253 $(CFACCLINK) -O0 $(@).o -o $(abspath $(@)) 254 rm $(abspath $(@)).o 242 255 243 256 #------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.