checkedc-llvm-test-suite/TEST.simple.Makefile

58 строки
2.1 KiB
Makefile

##===- TEST.nightly.Makefile ------------------------------*- Makefile -*--===##
#
# This test is used in conjunction with the llvm/utils/NightlyTest* stuff to
# generate information about program status for the nightly report.
#
##===----------------------------------------------------------------------===##
CURDIR := $(shell cd .; pwd)
PROGDIR := $(PROJ_SRC_ROOT)
RELDIR := $(subst $(PROGDIR),,$(CURDIR))
REPORTS_TO_GEN := compile exec
REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN))
#$(PROGRAMS_TO_TEST:%=Output/%.simple.compile.report.txt): \
#Output/%.simple.compile.report.txt: Output/%.out-simple
# @echo > $@
# @printf "TEST-RESULT-compile-time: " >> $@
# -grep "^program" Output/$*.simple.compile.time >> $@
$(PROGRAMS_TO_TEST:%=Output/%.simple.compile.report.txt): \
Output/%.simple.compile.report.txt: Output/%.out-simple
@echo > $@
@-if test -f Output/$*.simple; then \
echo "TEST-PASS: compile $(RELDIR)/$*" >> $@; \
echo "TEST-RESULT-compile-success: pass" >> $@;\
else \
echo "TEST-FAIL: compile $(RELDIR)/$*" >> $@; \
fi
@-printf "TEST-RESULT-compile-time: " >> $@
@-grep "^program" Output/$*.simple.compile.time >> $@
$(PROGRAMS_TO_TEST:%=Output/%.simple.exec.report.txt): \
Output/%.simple.exec.report.txt: Output/%.exe-simple
@echo > $@
@-if test -f Output/$*.exe-simple; then \
head -n 100 Output/$*.exe-simple >> $@; \
echo "TEST-PASS: exec $(RELDIR)/$*" >> $@;\
echo "TEST-RESULT-exec-success: pass" >> $@;\
else \
echo "TEST-FAIL: exec $(RELDIR)/$*" >> $@;\
fi
@-printf "TEST-RESULT-exec-time: " >> $@
@-grep "^program" Output/$*.out-simple.time >> $@
# Overall tests: just run subordinate tests
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
Output/%.$(TEST).report.txt: $(addprefix Output/%.simple., $(REPORTS_SUFFIX))
$(VERB) $(RM) -f $@
@echo "---------------------------------------------------------------" >> $@
@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
@echo "---------------------------------------------------------------" >> $@
-cat $(addprefix Output/$*.simple., $(REPORTS_SUFFIX)) >> $@
$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
test.$(TEST).%: Output/%.$(TEST).report.txt
@-cat $<