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
|
ifeq ($(MAKELEVEL),0)
$(error Sorry, this makefile is not intended to be \
used directly. Please use the makefile in the toplevel \
directory of the ApectC++ source tree instead)
endif
SHELL=/bin/bash
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 CallPostfixOp STLString CFlowCycle \
IntroInBase NonInlineIntroInclude Bug267 Bug268 Bug271 MatchVirtual \
PctInClass IntroInAll Instantiation Slice NonInlineSliceInclude \
Empty Bug316 Derived Base Bug323 GlobalIds AnonymousStuff \
ForcedInclude Bug336 Bug353 Introspection \
RepoInvalid RepoVersion
# Doesn't work at the moment: Bug209
ACMSGTESTS := RepoInvalid RepoVersion
ACNORUN := $(filter $(ACMSGTESTS), $(ACTESTS))
ACRUN := $(filter-out $(ACNORUN), $(ACTESTS))
STDOUT_FILE := stdout.txt
STDERR_FILE := stderr.txt
ERROR_FILE := error.txt
all: $(addsuffix .make, $(ACRUN)) $(addsuffix .weave, $(ACNORUN))
@if [ -f $(ERROR_FILE) ];then \
echo -e "\n\n"; \
echo "+---------+"; \
echo "|ERRORS: |"; \
echo "+---------+"; \
cat $(ERROR_FILE); \
else \
echo -e "\n\n"; \
echo "All tests OK"; \
fi;\
rm -f $(STDOUT_FILE) $(STDERR_FILE) $(ERROR_FILE)
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>&-; \
cat $</feature.err >> $</feature.out; \
rm $</feature.err; \
exec 6>&1; \
exec 7>&2; \
exec > $(STDOUT_FILE); \
exec 2> $(STDERR_FILE); \
diff $</feature.out $</feature.ref; \
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: %
cd $< && $(MAKE) run
%.clean: %
cd $< && $(MAKE) clean
.PHONY: all clean run ref
|