1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
|
ifeq ($(REGRESSIONTEST),1)
MAKELEVEL := 1
endif
ifeq ($(MAKELEVEL),0)
$(error Sorry, this makefile is not intended to be \
used directly. Please use the makefile in the toplevel \
directory of the AspectC++ source tree instead)
endif
SHELL=/bin/bash
DIFF=diff --strip-trailing-cr
ACTESTS = Advice AdviceVirtualFct That StaticTrace Context NameMangling \
Forward StandAloneCalls UnknownTypeCheck AccessControl Result \
ArrayMangling MatchExpr ConsDesAdvice NestedClassFuncAdvice \
MacroCall CallAdvice CallOnRef TemplateExtCall Bug190 Bug191 Bug192 \
Order NonInlineIntros JPType PragmaOnce Bug207 \
AbstractDerivedAspect PragmaOnceObserver ThatConst PrivateResult \
VoidArg ArrayWrapper Bug216 Bug228 ExecAdviceRecursive ExternC \
ThatContext IntroIncludes Bug234 Bug234-2 Bug235 Bug239 \
ExecAdviceNewDelete ExecAdviceFriend CallPostfixOp STLString \
CFlowCycle Bug368 Bug179 RightlessCalls Bug477 \
IntroInBase Bug267 Bug268 Bug271 MatchVirtual \
PctInClass IntroInAll Instantiation Slice NonInlineSliceInclude \
Empty Bug316 Derived Base Bug323 GlobalIds AnonymousStuff \
ForcedInclude Bug336 Bug353 Introspection CallAccess Bug418 Bug209 \
MatchStatic Bug512 SliceJPAPI JPTL NamedPointcuts AspectPrivileges \
RepoInvalid RepoVersion Bug321 Bug484 Bug524 DisjointIds AspectOf \
MemberPointCut MatchScopeWithin \
Bug549 Bug552 Bug554 DefaultArgs Bug561 Bug564 Bug566 Bug570 \
Bug571-1 Bug571-2 Bug571-3 Bug575 Bug577 Bug427 AttribAligned \
VirtualPointcuts Bug580 MacroExpansion Bug768 Bug769 Bug770 Bug772 \
Bug781 Bug784 BugUsingAttribute
ifeq ($(FRONTEND),Clang)
ACTESTS += DataFlowAnalysis
ACTESTS += CallBuiltinOperator MemberPointCut2
ACTESTS += SimpleGetAdvice SimpleSetAdvice CompoundGetSetAdvice FunctionEntity \
SimpleRefAdvice SimpleAliasAccessMember SimpleGetSetFuncPtr \
ArrayAccessAdvice MatchScope GetBaseDerived \
Bug-Typenames DefaultArgs2 CallViaADN Bug574 GetConditional Bug576 \
Bug567 Bug568 Bug548 Bug589 Bug594 Bug598 CallRef Float128Basic \
EntityInfo VolatileResult Bug792 BugAttribInConstexpr StdCxx17
ACTESTS += Attribute_basic Attribute_inMacro Attribute_removeAttrs
#Attribute_pointcuts Attribute_params Attribute_paramEvaluation \
#Attribute_paramsIntrospection Attribute_stringParam
#TypePrinting_FunctionPointers <-- waiting for clang improvement
endif
# disabled: UnsizedArray
# to be removed: NonInlineIntroInclude
# (uses deprecated introduction syntax massively)
ACMSGTESTS := RepoInvalid RepoVersion Bug570
ACNORUN := $(filter $(ACMSGTESTS), $(ACTESTS))
ACRUN := $(filter-out $(ACNORUN), $(ACTESTS))
STDOUT_FILE := stdout.txt
STDERR_FILE := stderr.txt
ERROR_FILE := error.txt
# ***** The following is only used for the Akut testsystem (REGRESSIONTEST == 1) *****
# ====================================================================================
ifeq ($(REGRESSIONTEST),1)
define do_test_start
@COUNT=0;PASS=0;FAIL=0;
endef
define do_test_weave
COUNT=$$(($$COUNT+1)); \
echo ---START TEST $$COUNT: $1: is expected to PASS; \
unset LANG; \
exec 6>&1; \
exec 7>&2; \
exec > $(1)/feature.out; \
exec 2> $(1)/feature.err; \
$(MAKE) -s EXT="$(EXT)" -C $(1) ; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
cp $(1)/feature.err $(1)/feature.out; \
rm $(1)/feature.err; \
exec 6>&1; \
exec 7>&2; \
exec > $(STDOUT_FILE); \
exec 2> $(STDERR_FILE); \
$(MAKE) -s EXT="$(EXT)" -C $(1) diff-only; \
RET=$$?; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
if [ $$RET == 0 ];then \
echo ---END TEST $$COUNT: $1: PASS \(was expected to pass and did pass\); \
PASS=$$(($$PASS+1)); \
else \
cat $(STDOUT_FILE) ;\
cat $(STDERR_FILE) ;\
FAIL=$$(($$FAIL+1)); \
echo ---END TEST $$COUNT: $1: FAIL \(was expected to pass, but failed\); \
fi;
endef
define do_test_run
COUNT=$$(($$COUNT+1)); \
echo ---START TEST $$COUNT: $1: is expected to PASS; \
exec 6>&1; \
exec 7>&2; \
exec > $(STDOUT_FILE); \
exec 2> $(STDERR_FILE); \
$(MAKE) -s EXT="$(EXT)" -C $(1) ; \
RET=$$?; \
ERR_FLAG=C; \
if [ $$RET == 0 ];then \
$(MAKE) -s EXT="$(EXT)" -C $(1) diff; \
RET=$$?; \
ERR_FLAG=D; \
fi; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
if [ $$RET == 0 ];then \
echo ---END TEST $$COUNT: $1: PASS \(was expected to pass and did pass\); \
PASS=$$(($$PASS+1)); \
else \
cat $(STDOUT_FILE) ;\
cat $(STDERR_FILE) ;\
FAIL=$$(($$FAIL+1)); \
echo ---END TEST $$COUNT: $1: FAIL \(was expected to pass, but failed\); \
fi;
endef
define do_test_end
echo -n "---EXECUTIVE SUMMARY: " ;\
if [ $$FAIL -eq $$COUNT ]; then\
echo FAIL \(all tests failed\) ;\
elif [ $$FAIL -gt 0 ]; then \
echo PARTLY \($$(( $$PASS * 100 / $$COUNT ))% tests passed as expected\); \
else \
echo PASS \(all tests passed\) ;\
fi ;\
echo ---START SUMMARY; \
echo $$COUNT tests in this testcase; \
echo $$PASS tests passed as expected; \
echo $$FAIL tests did not pass as expected; \
echo $$FAIL expected to pass but failed; \
echo 0 expected to fail but passed; \
echo ---END SUMMARY
endef
regression_test:
$(call do_test_start) \
$(foreach T, $(ACRUN), $(call do_test_run, $(T))) \
$(foreach T, $(ACNORUN), $(call do_test_weave, $(T))) \
$(call do_test_end)
endif
# ================================================================================
# ***** The above is only used for the Akut testsystem (REGRESSIONTEST == 1) *****
all: $(addsuffix .make, $(ACRUN)) $(addsuffix .weave, $(ACNORUN))
@if [ -f $(ERROR_FILE) ];then \
echo -e "\n\n"; \
echo "+---------+"; \
echo "|ERRORS: |"; \
echo "+---------+"; \
cat $(ERROR_FILE); \
rm -f $(STDOUT_FILE) $(STDERR_FILE) $(ERROR_FILE); \
exit 1; \
else \
echo -e "\n\n"; \
echo "All tests OK"; \
rm -f $(STDOUT_FILE) $(STDERR_FILE); \
fi;\
ref: $(addsuffix .ref, $(ACTESTS))
refclean:
rm */feature.ref
run: $(addsuffix .run, $(ACRUN))
clean: $(addsuffix .clean, $(ACTESTS))
%.weave: %
@unset LANG; \
exec 6>&1; \
exec 7>&2; \
exec > $</feature.out; \
exec 2> $</feature.err; \
$(MAKE) -s EXT="$(EXT)" -C $< ; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
cp $</feature.err $</feature.out; \
rm $</feature.err; \
exec 6>&1; \
exec 7>&2; \
exec > $(STDOUT_FILE); \
exec 2> $(STDERR_FILE); \
$(MAKE) -s EXT="$(EXT)" -C $< diff-only; \
RET=$$?; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
if [ $$RET == 0 ];then \
echo -n "."; \
else \
ERR_FLAG=D; \
echo -n "[$$ERR_FLAG:$<]"; \
echo -ne "\n-----------------------------------------------------------------------------\n" >> $(ERROR_FILE); \
echo -n "TEST: $<" >> $(ERROR_FILE); \
echo -ne "\n-----------------------------------------------------------------------------\n" >> $(ERROR_FILE); \
echo -e "STDOUT:\n--------" >> $(ERROR_FILE); \
cat $(STDOUT_FILE) >> $(ERROR_FILE); \
echo >> $(ERROR_FILE); \
echo -e "STDERR:\n--------" >> $(ERROR_FILE); \
cat $(STDERR_FILE) >> $(ERROR_FILE); \
echo >> $(ERROR_FILE); \
fi;
%.make: %
@exec 6>&1; \
exec 7>&2; \
exec > $(STDOUT_FILE); \
exec 2> $(STDERR_FILE); \
$(MAKE) -s EXT="$(EXT)" -C $< ; \
RET=$$?; \
ERR_FLAG=C; \
if [ $$RET == 0 ];then \
$(MAKE) -s EXT="$(EXT)" -C $< diff; \
RET=$$?; \
ERR_FLAG=D; \
fi; \
exec 1>&6 6>&-; \
exec 2>&7 7>&-; \
if [ $$RET == 0 ];then \
echo -n "."; \
else \
echo -n "[$$ERR_FLAG:$<]"; \
echo -ne "\n-----------------------------------------------------------------------------\n" >> $(ERROR_FILE); \
echo -n "TEST: $<" >> $(ERROR_FILE); \
echo -ne "\n-----------------------------------------------------------------------------\n" >> $(ERROR_FILE); \
echo -e "STDOUT:\n--------" >> $(ERROR_FILE); \
cat $(STDOUT_FILE) >> $(ERROR_FILE); \
echo >> $(ERROR_FILE); \
echo -e "STDERR:\n--------" >> $(ERROR_FILE); \
cat $(STDERR_FILE) >> $(ERROR_FILE); \
echo >> $(ERROR_FILE); \
fi;
%.ref: %
$(MAKE) -s EXT="$(EXT)" -C $< ref;
%.run: %
@echo Making and running test '$<'
cd $< && $(MAKE) run
%.clean: %
cd $< && $(MAKE) clean
.PHONY: all clean run ref
|