Fix file mode.
[llvm-testsuite.git] / TEST.simple.Makefile
blobf78c47d1208a64273ff12003f3ffd93c41e092a2
1 ##===- TEST.simple.Makefile -------------------------------*- Makefile -*--===##
3 # This test is used in conjunction with the llvm/utils/NightlyTest* stuff to
4 # generate information about program status for the nightly report.
6 ##===----------------------------------------------------------------------===##
8 CURDIR  := $(shell cd .; pwd)
9 PROGDIR := $(PROJ_SRC_ROOT)
10 RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
12 REPORTS_TO_GEN := compile exec
13 REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN))
15 #$(PROGRAMS_TO_TEST:%=Output/%.simple.compile.report.txt): \
16 #Output/%.simple.compile.report.txt: Output/%.out-simple
17 #       @echo > $@
18 #       @printf "TEST-RESULT-compile-time: " >> $@
19 #       -grep "^program" Output/$*.simple.compile.time >> $@
21 $(PROGRAMS_TO_TEST:%=Output/%.simple.compile.report.txt): \
22 Output/%.simple.compile.report.txt: Output/%.out-simple
23         @echo > $@
24         @-if test -f Output/$*.simple; then \
25           echo "TEST-PASS: compile $(RELDIR)/$*" >> $@; \
26           echo "TEST-RESULT-compile-success: pass" >> $@;\
27         else \
28           echo "TEST-FAIL: compile $(RELDIR)/$*" >> $@; \
29         fi
30         @-printf "TEST-RESULT-compile-time: " >> $@
31         @-grep "^program" Output/$*.simple.compile.time >> $@
33 $(PROGRAMS_TO_TEST:%=Output/%.simple.exec.report.txt): \
34 Output/%.simple.exec.report.txt: Output/%.exe-simple
35         @echo > $@
36         @-is_xfail=0; \
37         for i in $(EXEC_XFAILS); do \
38            if test "$*" == $$i; then \
39              is_xfail=1; \
40            fi; \
41         done; \
42         if test $$is_xfail == 1; then \
43           echo "TEST-XFAIL: exec $(RELDIR)/$*" >> $@;\
44           echo "TEST-RESULT-exec-success: xfail" >> $@;\
45         elif test -f Output/$*.exe-simple; then \
46           echo "TEST-PASS: exec $(RELDIR)/$*" >> $@;\
47           echo "TEST-RESULT-exec-success: pass" >> $@;\
48         else  \
49           echo "TEST-FAIL: exec $(RELDIR)/$*" >> $@;\
50         fi
51         @-printf "TEST-RESULT-exec-time: " >> $@
52         @-grep "^program" Output/$*.out-simple.time >> $@
53         if test -f Output/$*.extra-results.txt; then \
54           $(PROGDIR)/ParseMultipleResults $(RELDIR)/$* Output/$*.extra-results.txt >> $@; \
55         fi
57 # Overall tests: just run subordinate tests
58 $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
59 Output/%.$(TEST).report.txt: $(addprefix Output/%.simple., $(REPORTS_SUFFIX))
60         $(VERB) $(RM) -f $@
61         @echo "---------------------------------------------------------------" >> $@
62         @echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
63         @echo "---------------------------------------------------------------" >> $@
64         -cat $(addprefix Output/$*.simple., $(REPORTS_SUFFIX)) >> $@
66 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
67 test.$(TEST).%: Output/%.$(TEST).report.txt
68         @-cat $<