Changeset e2887a9
- Timestamp:
- May 12, 2023, 6:51:41 PM (19 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- b3ce76f
- Parents:
- 4dd10fb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r4dd10fb re2887a9 11 11 ## Created On : Sun May 31 22:14:18 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon May 1 16:38:04202314 ## Update Count : 3213 ## Last Modified On : Fri May 12 18:30:01 2023 14 ## Update Count : 42 15 15 ############################################################################### 16 17 # user targets:18 # Compile compiler/runtime and run test suite.19 # $ make check / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]20 #21 # $ make installcheck [debug=yes/no] installed=yes [arch=x86/x64/arm]22 16 23 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names … … 30 24 DIST_SUBDIRS = driver src . libcfa tests 31 25 32 @LIBCFA_TARGET_MAKEFILES@ : Makefile $ (srcdir)/libcfa/configure33 @$ (eval config_file = $(dir $@)config.data)34 @ls $ (config_file)|| (echo "Missing config.data, re-run configure script again" && false)35 @$ (eval config_data = $(shell cat $(config_file)))36 @echo "Configuring libcfa ($ (abs_top_srcdir)/libcfa/configure) with '$(config_data)' from $(shell pwd) / $(dir $@)"37 @cd $ (dir $@) && $(abs_top_srcdir)/libcfa/configure $(config_data)26 @LIBCFA_TARGET_MAKEFILES@ : Makefile ${srcdir}/libcfa/configure 27 @${eval config_file = ${dir ${@}}config.data} 28 @ls ${config_file} || (echo "Missing config.data, re-run configure script again" && false) 29 @${eval config_data = ${shell cat ${config_file}}} 30 @echo "Configuring libcfa (${abs_top_srcdir}/libcfa/configure) with '${config_data}' from ${shell pwd} / ${dir ${@}}" 31 @cd ${dir ${@}} && ${abs_top_srcdir}/libcfa/configure ${config_data} 38 32 39 33 noinst_DATA = @LIBCFA_TARGET_MAKEFILES@ … … 45 39 debug ?= yes 46 40 installed ?= no 47 ARCH = $ (if $(arch),"arch=$(arch)")41 ARCH = ${if ${arch},"arch=${arch}"} 48 42 49 check :50 $ (MAKE) -C tests tests installed=$(installed) debug=$(debug) $(ARCH)43 check : 44 ${MAKE} -C tests tests installed=${installed} debug=${debug} ${ARCH} 51 45 52 tests : check # synonym46 tests : check # synonym 53 47 54 installcheck :55 $ (MAKE) -C tests tests installed=yes debug=$(debug) $(ARCH)48 installcheck : 49 ${MAKE} -C tests tests installed=yes debug=${debug} ${ARCH} 56 50 57 configure-libcfa: @LIBCFA_TARGET_MAKEFILES@ 51 installtest : installcheck # synonym 52 53 help : 54 @echo "user targets:" 55 @echo " Compile compiler/runtime and run test suite." 56 @echo " $$ make check / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]" 57 @echo "" 58 @echo " Compile compiler/runtime, run test suite, and install." 59 @echo " $$ make installcheck / installtests [debug=yes/no] installed=yes [arch=x86/x64/arm]" 60 61 configure-libcfa : @LIBCFA_TARGET_MAKEFILES@ 58 62 @true 59 63 60 status : @LIBCFA_TARGET_MAKEFILES@64 status : @LIBCFA_TARGET_MAKEFILES@ 61 65 @echo -ne "translator\n\t" 62 66 @./config.status --config | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" 63 67 @find libcfa -name config.status -printf "\n%h\n\t" -exec {} --config \; | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" 64 68 65 @LIBCFA_TARGET_DIRS@ ::66 $ (MAKE) -C $@ $(MAKECMDGOALS)69 @LIBCFA_TARGET_DIRS@ :: 70 ${MAKE} -C ${@} ${MAKECMDGOALS} 67 71 68 mostlyclean clean distclean maintainer-clean : @LIBCFA_TARGET_DIRS@72 mostlyclean clean distclean maintainer-clean : @LIBCFA_TARGET_DIRS@ -
tests/Makefile.am
r4dd10fb re2887a9 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon May 1 17:25:24202314 ## Update Count : 1 4513 ## Last Modified On : Fri May 12 18:03:57 2023 14 ## Update Count : 176 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]23 16 24 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names … … 27 20 include $(top_srcdir)/tools/build/cfa.make 28 21 29 DEFAULT_INCLUDES = -I$ (abs_srcdir)22 DEFAULT_INCLUDES = -I${abs_srcdir} 30 23 31 24 debug ?= yes 32 25 installed ?= no 33 ARCH=$ (if $(arch),"--arch=$(arch)")26 ARCH=${if ${arch},"--arch=${arch}"} 34 27 archiveerrors= 35 28 … … 41 34 timeouts= 42 35 43 TEST_PY = python3 $ (builddir)/test.py36 TEST_PY = python3 ${builddir}/test.py 44 37 45 38 # applies to both programs 46 39 # since automake doesn't have support for CFA we have to 47 AM_CFLAGS = $ (if $(test), 2> $(test), )\48 -fdebug-prefix-map=$ (abspath $(abs_srcdir))= \40 AM_CFLAGS = ${if ${test}, 2> ${test}, } \ 41 -fdebug-prefix-map=${abspath ${abs_srcdir}}= \ 49 42 -fdebug-prefix-map=/tmp= \ 50 43 -fno-diagnostics-show-caret \ … … 59 52 60 53 # get the desired cfa to test 61 TARGET_CFA = $ (if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)54 TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@} 62 55 63 56 # adjust CC to current flags 64 CC = LC_ALL=C $ (if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))65 CFACC = $ (CC)57 CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}} 58 CFACC = ${CC} 66 59 67 60 # get local binary for depedencies … … 69 62 70 63 # adjusted CC but without the actual distcc call 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)&&75 76 .PHONY : list .validate .test_makeflags77 .INTERMEDIATE : .validate .validate.cfa .test_makeflags64 CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}} 65 CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} 66 67 PRETTY_PATH=mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} && 68 69 .PHONY : list .validate .test_makeflags 70 .INTERMEDIATE : .validate .validate.cfa .test_makeflags 78 71 EXTRA_PROGRAMS = avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install 79 72 EXTRA_DIST = test.py \ … … 101 94 dist-hook: 102 95 echo "Gathering test files" 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}; \96 for file in `${TEST_PY} --list-dist`; do \ 97 if test -f ${srcdir}/$${file}; then \ 98 ${MKDIR_P} $$(dirname ${distdir}/$${file}); \ 99 cp -df ${srcdir}/$${file} ${distdir}/$${file}; \ 107 100 fi; \ 108 101 done 109 110 102 111 103 avl_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 … … 118 110 119 111 all-local : # This name is important to automake and implies the default build target. 120 @+$ (TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH)--all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program112 @+${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 121 113 122 114 install : all-local # PAB only … … 125 117 126 118 quick : 127 @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) $(quick_test) 119 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${ARCH} ${quick_test} 120 121 concurrency : 122 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCH} -Iconcurrent 123 124 list : 125 @+${TEST_PY} --list ${concurrent} 126 127 help : 128 @echo "user targets:" 129 @echo " Run the complete test suite." 130 @echo " $$ make (null) / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]" 131 @echo "" 132 @echo " Run the short (quick) test suite." 133 @echo " $$ make quick [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]" 134 @echo "" 135 @echo " Run the concurrent test suite." 136 @echo " $$ make concurrency [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]" 137 @echo "" 138 @echo " List all tests in the test suite." 139 @echo " $$ make list" 128 140 129 141 mostlyclean-local : 130 find $ (builddir)-not -path './__pycache__/*' -path '*.o' -delete131 find $ (builddir)-not -path './__pycache__/*' -path '*/.err/*.log' -delete132 find $ (builddir)-not -path './__pycache__/*' -path '*/.out/*.log' -delete133 rm -f $ (EXTRA_PROGRAMS)142 find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete 143 find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete 144 find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete 145 rm -f ${EXTRA_PROGRAMS} 134 146 rm -rf __pycache__ 135 147 136 148 distclean-local : 137 find $(builddir) -path '*.Po' -delete 138 139 list : 140 @+$(TEST_PY) --list $(concurrent) 149 find ${builddir} -path '*.Po' -delete 141 150 142 151 .test_makeflags: 143 @echo "$ (MAKEFLAGS)"152 @echo "${MAKEFLAGS}" 144 153 145 154 .validate: .validate.cfa 146 $ (CFACOMPILE).validate.cfa -fsyntax-only -Wall -Wextra -Werror155 ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror 147 156 148 157 .validate.cfa: 149 @echo "int main() { return 0; }" > $ (@)158 @echo "int main() { return 0; }" > ${@} 150 159 151 160 # automake doesn't know we still need C rules so pretend like we have a C program 152 161 .dummy_hack.c: 153 @echo "int main() { return 0; }" > $ (@)162 @echo "int main() { return 0; }" > ${@} 154 163 155 164 .dummy_hackxx.cpp: 156 @echo "int bar() { return 0; }" > $(@) 157 158 concurrency : 159 @+$(TEST_PY) --debug=$(debug) --install=$(installed) -Iconcurrent 165 @echo "int bar() { return 0; }" > ${@} 160 166 161 167 #---------------------------------------------------------------------------------------------------------------- 162 168 163 169 # Use for all tests, make sure the path are correct and all flags are added 164 CFACOMPILETEST=$ (PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) $($(shell echo "$(@)_FLAGSCFA" | sed 's/-\|\//_/g'))170 CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}} 165 171 166 172 #---------------------------------------------------------------------------------------------------------------- … … 169 175 # split into two steps to support compiling remotely using distcc 170 176 # don't use distcc to do the linking because distcc doesn't do linking 171 % : %.cfa $ (CFACCBIN)172 $ (CFACOMPILETEST) -c -o $(abspath $(@)).o -DIN_DIR="$(abspath $(dir $(<)))/.in/"173 $ (CFACCLINK) $(@).o -o $(abspath $(@))174 rm $ (abspath $(@)).o177 % : %.cfa ${CFACCBIN} 178 ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/" 179 ${CFACCLINK} ${@}.o -o ${abspath ${@}} 180 rm ${abspath ${@}}.o 175 181 176 182 # implicit rule for c++ test 177 183 # convient for testing the testsuite itself but not actuall used 178 184 % : %.cpp 179 $ (PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) -o $(abspath $(@))185 ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}} 180 186 181 187 #------------------------------------------------------------------------------ … … 188 194 # Generated code 189 195 GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions 190 $ (GENERATED_CODE): % : %.cfa $(CFACCBIN)191 $ (CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $(@))196 ${GENERATED_CODE} : % : %.cfa ${CFACCBIN} 197 ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}} 192 198 193 199 #------------------------------------------------------------------------------ … … 195 201 #------------------------------------------------------------------------------ 196 202 # tests that just validate syntax and compiler output should be compared to stderr 197 CFACOMPILE_SYNTAX = $ (CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $(@))203 CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}} 198 204 199 205 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \ 200 206 init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrent/waitfor/parse 201 $ (SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)202 $ (CFACOMPILE_SYNTAX)203 $ (if $(test), cp $(test) $(abspath $(@)), )207 ${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN} 208 ${CFACOMPILE_SYNTAX} 209 ${if ${test}, cp ${test} ${abspath ${@}}, } 204 210 205 211 # expected failures 206 212 # use custom target since they require a custom define *and* have a name that doesn't match the file 207 alloc-ERROR : alloc.cfa $ (CFACCBIN)208 $ (CFACOMPILE_SYNTAX)-DERR1209 -cp $ (test) $(abspath $(@))210 211 init1-ERROR : init1.cfa $ (CFACCBIN)212 $ (CFACOMPILE_SYNTAX)-DERR1213 -cp $ (test) $(abspath $(@))214 215 typedefRedef-ERR1 : typedefRedef.cfa $ (CFACCBIN)216 $ (CFACOMPILE_SYNTAX)-DERR1217 -cp $ (test) $(abspath $(@))218 219 nested-types-ERR1 : nested-types.cfa $ (CFACCBIN)220 $ (CFACOMPILE_SYNTAX)-DERR1221 -cp $ (test) $(abspath $(@))222 223 nested-types-ERR2 : nested-types.cfa $ (CFACCBIN)224 $ (CFACOMPILE_SYNTAX)-DERR2225 -cp $ (test) $(abspath $(@))226 227 raii/memberCtors-ERR1 : raii/memberCtors.cfa $ (CFACCBIN)228 $ (CFACOMPILE_SYNTAX)-DERR1229 -cp $ (test) $(abspath $(@))230 231 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $ (CFACCBIN)232 $ (CFACOMPILE_SYNTAX)-DERR1233 -cp $ (test) $(abspath $(@))234 235 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $ (CFACCBIN)236 $ (CFACOMPILE_SYNTAX)-DERR1237 -cp $ (test) $(abspath $(@))238 239 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $ (CFACCBIN)240 $ (CFACOMPILE_SYNTAX)-DERR2241 -cp $ (test) $(abspath $(@))213 alloc-ERROR : alloc.cfa ${CFACCBIN} 214 ${CFACOMPILE_SYNTAX} -DERR1 215 -cp ${test} ${abspath ${@}} 216 217 init1-ERROR : init1.cfa ${CFACCBIN} 218 ${CFACOMPILE_SYNTAX} -DERR1 219 -cp ${test} ${abspath ${@}} 220 221 typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN} 222 ${CFACOMPILE_SYNTAX} -DERR1 223 -cp ${test} ${abspath ${@}} 224 225 nested-types-ERR1 : nested-types.cfa ${CFACCBIN} 226 ${CFACOMPILE_SYNTAX} -DERR1 227 -cp ${test} ${abspath ${@}} 228 229 nested-types-ERR2 : nested-types.cfa ${CFACCBIN} 230 ${CFACOMPILE_SYNTAX} -DERR2 231 -cp ${test} ${abspath ${@}} 232 233 raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN} 234 ${CFACOMPILE_SYNTAX} -DERR1 235 -cp ${test} ${abspath ${@}} 236 237 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN} 238 ${CFACOMPILE_SYNTAX} -DERR1 239 -cp ${test} ${abspath ${@}} 240 241 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN} 242 ${CFACOMPILE_SYNTAX} -DERR1 243 -cp ${test} ${abspath ${@}} 244 245 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN} 246 ${CFACOMPILE_SYNTAX} -DERR2 247 -cp ${test} ${abspath ${@}} 242 248 243 249 # Exception Tests 244 250 # Test with libcfathread; it changes how storage works. 245 251 246 exceptions/%-threads : exceptions/%.cfa $ (CFACCBIN)247 $ (CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath $(@)).o248 $ (CFACCLOCAL) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath $(@)).o -o $(abspath $(@))252 exceptions/%-threads : exceptions/%.cfa ${CFACCBIN} 253 ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o 254 ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}} 249 255 250 256 # Linking tests 251 257 # Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls) 252 linking/linkerror : linking/linkerror.cfa $ (CFACCBIN)253 $ (CFACOMPILETEST) -O0 -c -o $(abspath $(@)).o254 $ (CFACCLINK) -O0 $(@).o -o $(abspath $(@))255 rm $ (abspath $(@)).o258 linking/linkerror : linking/linkerror.cfa ${CFACCBIN} 259 ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o 260 ${CFACCLINK} -O0 ${@}.o -o ${abspath ${@}} 261 rm ${abspath ${@}}.o 256 262 257 263 #------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.