42 TEST_ROOT := $(shell pwd) |
42 TEST_ROOT := $(shell pwd) |
43 |
43 |
44 # Default bundle of all test results (passed or not) |
44 # Default bundle of all test results (passed or not) |
45 JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
45 JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
46 |
46 |
47 # Default home for JTREG |
|
48 ifeq ($(PLATFORM), windows) |
47 ifeq ($(PLATFORM), windows) |
49 SLASH_JAVA = J: |
48 SLASH_JAVA = J: |
50 else |
49 else |
51 SLASH_JAVA = /java |
50 SLASH_JAVA = /java |
52 endif |
51 endif |
53 |
52 |
54 # Default JTREG to run |
53 # Default JTREG to run |
55 JT_HOME = $(SLASH_JAVA)/svc/jct-tools3.2.2_02 |
54 ifdef JPRT_JTREG_HOME |
56 JTREG = $(JT_HOME)/$(JT_PLATFORM)/bin/jtreg |
55 JTREG_HOME = $(JPRT_JTREG_HOME) |
|
56 else |
|
57 JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg |
|
58 endif |
|
59 JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg |
57 |
60 |
58 # Default JDK for JTREG |
61 # Default JDK for JTREG |
59 ifdef JPRT_JAVA_HOME |
62 ifdef JPRT_JAVA_HOME |
60 JT_JAVA = $(JPRT_JAVA_HOME) |
63 JT_JAVA = $(JPRT_JAVA_HOME) |
61 else |
64 else |
62 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
65 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
63 endif |
66 endif |
64 |
67 |
65 # Default JDK to test |
68 # Default JDK to test |
66 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
69 ifdef JPRT_IMPORT_PRODUCT_HOME |
|
70 TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) |
|
71 else |
|
72 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
|
73 endif |
|
74 |
67 TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
75 TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
68 |
76 |
69 # The test directories to run |
77 # The test directories to run |
70 DEFAULT_TESTDIRS = . |
78 DEFAULT_TESTDIRS = . |
71 TESTDIRS = $(DEFAULT_TESTDIRS) |
79 TESTDIRS = $(DEFAULT_TESTDIRS) |
72 |
80 |
73 # Root of all test results |
81 # Root of all test results |
74 TEST_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH) |
82 TEST_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH) |
75 |
83 |
76 # Export this setting and pass it in. |
|
77 JAVA_TOOL_OPTIONS = -Djava.awt.headless=true |
|
78 export JAVA_TOOL_OPTIONS |
|
79 |
|
80 # Default make rule |
84 # Default make rule |
81 all javac javadoc javah javap apt: clean check jtreg-tests $(JPRT_ARCHIVE_BUNDLE) |
85 all apt javac javadoc javah javap: clean check jtreg-tests $(JPRT_ARCHIVE_BUNDLE) |
82 @echo "Testing completed successfully" |
86 @echo "Testing completed successfully" |
83 |
87 |
84 # for use with JPRT -testrule |
88 # for use with JPRT -testrule |
85 all: TESTDIRS = . |
89 all: TESTDIRS = . |
86 javac fastjavac: TESTDIRS = tools/javac |
90 apt: TESTDIRS = tools/apt |
|
91 javac: TESTDIRS = tools/javac |
87 javadoc: TESTDIRS = tools/javadoc com/sun/javadoc |
92 javadoc: TESTDIRS = tools/javadoc com/sun/javadoc |
88 javah: TESTDIRS = tools/javah |
93 javah: TESTDIRS = tools/javah |
89 javap: TESTDIRS = tools/javap |
94 javap: TESTDIRS = tools/javap |
90 apt: TESTDIRS = tools/apt |
|
91 |
|
92 fastjavac: SAMEVM = -samevm |
|
93 |
95 |
94 # Check to make sure these directories exist |
96 # Check to make sure these directories exist |
95 check: $(JT_HOME) $(PRODUCT_HOME) $(JTREG) |
97 check: $(JT_HOME) $(PRODUCT_HOME) $(JTREG) |
96 |
98 |
97 # Run the tests |
99 # Run the tests |
98 jtreg-tests: FRC |
100 jtreg-tests: FRC |
99 ls /opt/jprt /opt/jprt/jdk* |
|
100 @echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)" |
101 @echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)" |
101 @rm -f -r $(TEST_OUTPUT_DIR)/JTwork $(TEST_OUTPUT_DIR)/JTreport |
102 @rm -f -r $(TEST_OUTPUT_DIR)/JTwork $(TEST_OUTPUT_DIR)/JTreport |
102 @mkdir -p $(TEST_OUTPUT_DIR) |
103 @mkdir -p $(TEST_OUTPUT_DIR) |
103 JT_JAVA=$(JT_JAVA) $(JTREG) -k:\!ignore -a -v:fail,error $(SAMEVM) \ |
104 JT_JAVA=$(JT_JAVA) $(JTREG) \ |
|
105 -a -samevm -k:\!ignore -v:fail,error,nopass \ |
104 -r:$(TEST_OUTPUT_DIR)/JTreport \ |
106 -r:$(TEST_OUTPUT_DIR)/JTreport \ |
105 -w:$(TEST_OUTPUT_DIR)/JTwork \ |
107 -w:$(TEST_OUTPUT_DIR)/JTwork \ |
106 -jdk:$(TESTJAVA) \ |
108 -jdk:$(TESTJAVA) \ |
107 -Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
109 -Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
108 $(JAVA_TOOL_OPTIONS:%=-vmoption:%) \ |
|
109 $(JAVA_ARGS:%=-vmoption:%) \ |
110 $(JAVA_ARGS:%=-vmoption:%) \ |
110 $(TESTDIRS) |
111 $(TESTDIRS) \ |
|
112 || ( status=$$? ; \ |
|
113 echo ; echo "Summary of test failures" ; \ |
|
114 cat $(TEST_OUTPUT_DIR)/JTreport/text/summary.txt | \ |
|
115 grep -v 'Not run' | grep -v 'Passed' ; \ |
|
116 echo ; \ |
|
117 exit $$status ) |
111 |
118 |
112 # Bundle up the results |
119 # Bundle up the results |
113 $(JPRT_ARCHIVE_BUNDLE): FRC |
120 $(JPRT_ARCHIVE_BUNDLE): FRC |
114 @rm -f $@ |
121 @rm -f $@ |
115 @mkdir -p $(@D) |
122 @mkdir -p $(@D) |