changeset 52:d6d46e2d0fc8

6960335: Add top level 'make test' rule that uses test/Makefile, runs all test batches Reviewed-by: darcy, jjg
author ohair
date Thu, 10 Jun 2010 14:31:21 -0700
parents eeb832793cd6
children e79c0d2e6512
files Makefile test/Makefile
diffstat 2 files changed, 50 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Jun 09 15:23:33 2010 -0700
+++ b/Makefile	Thu Jun 10 14:31:21 2010 -0700
@@ -494,6 +494,47 @@
 	$(MAKE) ALT_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image product_build
 
 ################################################################
+# rule to test
+################################################################
+
+.NOTPARALLEL: test
+
+test: test_clean test_start test_summary
+
+test_start:
+	@$(ECHO) "Tests started at `$(DATE)`"
+
+test_clean:
+	$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
+
+test_summary: $(OUTPUTDIR)/test_failures.txt
+	@$(ECHO) "#################################################"
+	@$(ECHO) "Tests completed at `$(DATE)`"
+	@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
+	   || $(ECHO) "No TEST STATS seen in log" )
+	@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
+	@$(ECHO) "#################################################"
+	@if [ -s $< ] ; then                                           \
+	  $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
+	  $(CAT) $<;                                                   \
+	  exit 1;                                                      \
+	else							       \
+	  $(ECHO) "Success! No failures detected";		       \
+	fi
+
+# Get failure list from log
+$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
+	@$(RM) $@
+	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) > $@
+
+# Get log file of all tests run
+$(OUTPUTDIR)/test_log.txt:
+	$(RM) $@
+	( $(CD) test &&                                                   \
+	  $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(ABS_OUTPUTDIR)/j2sdk-image \
+	) | tee $@
+
+################################################################
 # JPRT rule to build
 ################################################################
 
@@ -503,7 +544,7 @@
 #  PHONY
 ################################################################
 
-.PHONY: all build what clobber insane \
+.PHONY: all build what clobber insane test test_start test_summary test_clean \
 	fastdebug_build debug_build product_build setup \
         dev dev-build dev-sanity dev-clobber
 
--- a/test/Makefile	Wed Jun 09 15:23:33 2010 -0700
+++ b/test/Makefile	Thu Jun 10 14:31:21 2010 -0700
@@ -54,7 +54,6 @@
 
 # Test target list for jdk repository
 JDK_TEST_LIST = \
-	jdk_awt \
 	jdk_beans jdk_beans1 jdk_beans2 jdk_beans3  \
 	jdk_io  \
 	jdk_lang  \
@@ -63,21 +62,25 @@
 	jdk_misc  \
 	jdk_net  \
 	jdk_nio  \
-	jdk_rmi \
 	jdk_security jdk_security1 jdk_security2 jdk_security3  \
-	jdk_swing \
 	jdk_text  \
 	jdk_tools jdk_tools1 jdk_tools2  \
 	jdk_util
 
+# These tests need a DISPLAY and can create window interaction complications
+JDK_TEST_LIST2 = \
+	jdk_awt \
+	jdk_rmi \
+	jdk_swing
+
 # Default test target (everything)
 all: $(JDK_TEST_LIST) $(LANGTOOLS_TEST_LIST)
 
 # Test targets
 $(LANGTOOLS_TEST_LIST):
-	@$(call SUBDIR_TEST, $(LANGTOOLS_DIR), $(subst langtools_,,$@))
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), $(subst langtools_,,$@))
 $(JDK_TEST_LIST):
-	@$(call SUBDIR_TEST, $(JDK_DIR), $@)
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), $@)
 
 clean: