[llvm-commits] [test-suite] r105124 - in /test-suite/trunk: Makefile.programs MultiSource/Makefile.multisrc SingleSource/Makefile.singlesrc TEST.simple.Makefile TEST.simple.report
Daniel Dunbar
daniel at zuster.org
Sat May 29 17:48:15 PDT 2010
Author: ddunbar
Date: Sat May 29 19:48:15 2010
New Revision: 105124
URL: http://llvm.org/viewvc/llvm-project?rev=105124&view=rev
Log:
Add 'TEST=simple', which runs a nightly test that only uses the compiler under test to build files, and doesn't rely on 'llc', 'opt', etc...
Added:
test-suite/trunk/TEST.simple.Makefile
test-suite/trunk/TEST.simple.report
Modified:
test-suite/trunk/Makefile.programs
test-suite/trunk/MultiSource/Makefile.multisrc
test-suite/trunk/SingleSource/Makefile.singlesrc
Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=105124&r1=105123&r2=105124&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Sat May 29 19:48:15 2010
@@ -42,7 +42,7 @@
include $(LEVEL)/Makefile.tests
-.PRECIOUS: Output/%.llvm Output/%.native Output/%.llc Output/%.llc.s
+.PRECIOUS: Output/%.llvm Output/%.native Output/%.simple Output/%.llc Output/%.llc.s
.PRECIOUS: Output/%.cbe Output/%.cbe.c Output/%.llvm.bc Output/%.linked.bc
.PRECIOUS: Output/%.linked.optbeta.bc Output/%.llvm.optbeta.bc
@@ -91,8 +91,10 @@
ifdef GET_STABLE_NUMBERS
RUNSAFELY := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK)
+RUNSAFELYLOCAL := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK)
else
RUNSAFELY := $(PROGDIR)/RunSafely.sh
+RUNSAFELYLOCAL := $(PROGDIR)/RunSafely.sh
ifdef REMOTE_HOST
RUNSAFELY := $(RUNSAFELY) -r $(REMOTE_HOST)
@@ -118,6 +120,7 @@
endif
RUNSAFELY := $(RUNSAFELY) $(RUNTIMELIMIT) $(EXIT_OK)
+RUNSAFELYLOCAL := $(RUNSAFELYLOCAL) $(RUNTIMELIMIT) $(EXIT_OK)
endif
RUNTOOLSAFELY := $(PROGDIR)/RunToolSafely.sh $(RUNTIMELIMIT)
@@ -508,6 +511,10 @@
endif
endif
+$(PROGRAMS_TO_TEST:%=Output/%.out-simple): \
+Output/%.out-simple: Output/%.simple
+ $(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
$(PROGRAMS_TO_TEST:%=Output/%.out-lli): \
Output/%.out-lli: Output/%.llvm.bc $(LLI)
$(RUNSAFELY) $(STDIN_FILENAME) $@ $(LLI) -info-output-file=$(CURDIR)/$@.info $(STATS) $(LLI_OPTS) $< $(RUN_OPTIONS)
@@ -669,6 +676,10 @@
DIFFPROG = touch $@ \#
endif
+$(PROGRAMS_TO_TEST:%=Output/%.diff-simple): \
+Output/%.diff-simple: Output/%.out-nat Output/%.out-simple
+ -$(DIFFPROG) simple $* $(HIDEDIFF)
+
$(PROGRAMS_TO_TEST:%=Output/%.diff-lli): \
Output/%.diff-lli: Output/%.out-nat Output/%.out-lli
-$(DIFFPROG) lli $* $(HIDEDIFF)
@@ -698,6 +709,11 @@
-$(DIFFPROG) cbe $* $(HIDEDIFF)
ifndef DISABLE_DIFFS
+$(PROGRAMS_TO_TEST:%=Output/%.exe-simple): \
+Output/%.exe-simple: Output/%.diff-simple
+ -rm -f $@
+ -cp $< $@
+
$(PROGRAMS_TO_TEST:%=Output/%.exe-lli): \
Output/%.exe-lli: Output/%.diff-lli
-rm -f $@
Modified: test-suite/trunk/MultiSource/Makefile.multisrc
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Makefile.multisrc?rev=105124&r1=105123&r2=105124&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Makefile.multisrc (original)
+++ test-suite/trunk/MultiSource/Makefile.multisrc Sat May 29 19:48:15 2010
@@ -25,7 +25,10 @@
NObjs := $(sort $(addsuffix .o, $(notdir $(basename $(Source)))))
NObjects := $(addprefix Output/,$(NObjs))
-.PRECIOUS: $(LObjects) $(NObjects)
+NLObjs := $(sort $(addsuffix .llvm.o, $(notdir $(basename $(Source)))))
+NLObjects := $(addprefix Output/,$(NLObjs))
+
+.PRECIOUS: $(LObjects) $(NObjects) $(NLObjects)
Output/%.o: %.c Output/.dir
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
@@ -39,6 +42,25 @@
Output/%.o: %.cc Output/.dir
-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.c Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.m Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.C Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.cpp Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.cc Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.mm Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+
bugpoint-opt: Output/$(PROG).bugpoint-opt
bugpoint-gccas: Output/$(PROG).bugpoint-opt
bugpoint-llvm-ld: Output/$(PROG).bugpoint-llvm-ld
@@ -62,6 +84,14 @@
endif
+Output/%.simple: $(NLObjects)
+ @-cat $(NLObjects:%=%.compile.time) | awk -- '\
+BEGIN { sum = 0.0; }\
+/^program/ { sum += $$2; }\
+!/^program/ { print; }\
+END { printf("program %f\n", sum); }' > $@.compile.time
+ -$(LCXX) -o $@ $^ $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
+
Output/%.native: $(NObjects)
-$(CXX) -o $@ $(NObjects) $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
Modified: test-suite/trunk/SingleSource/Makefile.singlesrc
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Makefile.singlesrc?rev=105124&r1=105123&r2=105124&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Makefile.singlesrc (original)
+++ test-suite/trunk/SingleSource/Makefile.singlesrc Sat May 29 19:48:15 2010
@@ -48,6 +48,30 @@
cat $< | wc -l > $@
endif
+Output/%.llvm.o: %.c Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.m Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.C Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.cpp Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.cc Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+Output/%.llvm.o: %.mm Output/.dir
+ $(RUNSAFELYLOCAL) /dev/null $@.compile \
+ $(LCXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@
+.PRECIOUS: Output/%.llvm.o
+
+Output/%.simple: Output/%.llvm.o Output/.dir
+ -$(CP) $<.compile.time $@.compile.time
+ -$(LCXX) -o $@ $< $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS)
+
# FIXME: LIBS should be specified, not hardcoded to -lm
Output/%.native: $(SourceDir)/%.c Output/.dir
-$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
Added: test-suite/trunk/TEST.simple.Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.simple.Makefile?rev=105124&view=auto
==============================================================================
--- test-suite/trunk/TEST.simple.Makefile (added)
+++ test-suite/trunk/TEST.simple.Makefile Sat May 29 19:48:15 2010
@@ -0,0 +1,57 @@
+##===- 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 $<
Added: test-suite/trunk/TEST.simple.report
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.simple.report?rev=105124&view=auto
==============================================================================
--- test-suite/trunk/TEST.simple.report (added)
+++ test-suite/trunk/TEST.simple.report Sat May 29 19:48:15 2010
@@ -0,0 +1,30 @@
+##=== TEST.nightly.report - Report description for nightly -----*- perl -*-===##
+#
+# This file defines a report to be generated for the nightly tests.
+#
+##===----------------------------------------------------------------------===##
+
+# Sort by program name
+$SortCol = 0;
+$TrimRepeatedPrefix = 1;
+
+my $WallTimeRE = "Time: ([0-9.]+) seconds \\([0-9.]+ wall clock";
+
+# FormatTime - Convert a time from 1m23.45 into 83.45
+sub FormatTime {
+ my $Time = shift;
+ if ($Time =~ m/([0-9]+)[m:]([0-9.]+)/) {
+ return sprintf("%7.4f", $1*60.0+$2);
+ }
+
+ return sprintf("%7.4f", $Time);
+}
+
+(
+ ["Program" , '\'([^\']+)\' Program'],
+ [],
+ ["CC" , 'TEST-RESULT-compile-success: (pass)'],
+ ["CC_Time" , 'TEST-RESULT-compile-time: program\s*([.0-9m:]+)', \&FormatTime],
+ ["Exec" , 'TEST-RESULT-exec-success: (pass)'],
+ ["Exec_Time", 'TEST-RESULT-exec-time: program\s*([.0-9m:]+)', \&FormatTime],
+);
More information about the llvm-commits
mailing list