|
1 # |
|
2 # Makefile to run jtreg and any other tests |
|
3 # |
|
4 |
|
5 # Get OS/ARCH specifics |
|
6 OSNAME = $(shell uname -s) |
|
7 ifeq ($(OSNAME), SunOS) |
|
8 PLATFORM = solaris |
|
9 JT_PLATFORM = solaris |
|
10 ARCH = $(shell uname -p) |
|
11 ifeq ($(ARCH), i386) |
|
12 ARCH=i586 |
|
13 endif |
|
14 endif |
|
15 ifeq ($(OSNAME), Linux) |
|
16 PLATFORM = linux |
|
17 JT_PLATFORM = linux |
|
18 ARCH = $(shell uname -m) |
|
19 ifeq ($(ARCH), i386) |
|
20 ARCH=i586 |
|
21 endif |
|
22 endif |
|
23 ifeq ($(OSNAME), Windows_NT) |
|
24 PLATFORM = windows |
|
25 JT_PLATFORM = win32 |
|
26 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) |
|
27 ARCH=ia64 |
|
28 else |
|
29 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) |
|
30 ARCH=x64 |
|
31 else |
|
32 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) |
|
33 ARCH=x64 |
|
34 else |
|
35 ARCH=i586 |
|
36 endif |
|
37 endif |
|
38 endif |
|
39 endif |
|
40 |
|
41 # Root of this test area (important to use full paths in some places) |
|
42 TEST_ROOT := $(shell pwd) |
|
43 |
|
44 # Default bundle of all test results (passed or not) |
|
45 JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
|
46 |
|
47 # Default home for JTREG |
|
48 ifeq ($(PLATFORM), windows) |
|
49 SLASH_JAVA = J: |
|
50 else |
|
51 SLASH_JAVA = /java |
|
52 endif |
|
53 |
|
54 # Default JTREG to run |
|
55 JT_HOME = $(SLASH_JAVA)/svc/jct-tools3.2.2_02 |
|
56 JTREG = $(JT_HOME)/$(JT_PLATFORM)/bin/jtreg |
|
57 |
|
58 # Default JDK for JTREG |
|
59 ifdef JPRT_JAVA_HOME |
|
60 JT_JAVA = $(JPRT_JAVA_HOME) |
|
61 else |
|
62 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
|
63 endif |
|
64 |
|
65 # Default JDK to test |
|
66 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
|
67 TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
|
68 |
|
69 # The test directories to run |
|
70 DEFAULT_TESTDIRS = . |
|
71 TESTDIRS = $(DEFAULT_TESTDIRS) |
|
72 |
|
73 # Root of all test results |
|
74 TEST_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH) |
|
75 |
|
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 |
|
81 all javac javadoc javah javap apt: clean check jtreg-tests $(JPRT_ARCHIVE_BUNDLE) |
|
82 @echo "Testing completed successfully" |
|
83 |
|
84 # for use with JPRT -testrule |
|
85 all: TESTDIRS = . |
|
86 javac fastjavac: TESTDIRS = tools/javac |
|
87 javadoc: TESTDIRS = tools/javadoc com/sun/javadoc |
|
88 javah: TESTDIRS = tools/javah |
|
89 javap: TESTDIRS = tools/javap |
|
90 apt: TESTDIRS = tools/apt |
|
91 |
|
92 fastjavac: SAMEVM = -samevm |
|
93 |
|
94 # Check to make sure these directories exist |
|
95 check: $(JT_HOME) $(PRODUCT_HOME) $(JTREG) |
|
96 |
|
97 # Run the tests |
|
98 jtreg-tests: FRC |
|
99 ls /opt/jprt /opt/jprt/jdk* |
|
100 @echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)" |
|
101 @rm -f -r $(TEST_OUTPUT_DIR)/JTwork $(TEST_OUTPUT_DIR)/JTreport |
|
102 @mkdir -p $(TEST_OUTPUT_DIR) |
|
103 JT_JAVA=$(JT_JAVA) $(JTREG) -k:\!ignore -a -v:fail,error $(SAMEVM) \ |
|
104 -r:$(TEST_OUTPUT_DIR)/JTreport \ |
|
105 -w:$(TEST_OUTPUT_DIR)/JTwork \ |
|
106 -jdk:$(TESTJAVA) \ |
|
107 -Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
|
108 -exclude:bootclasspath-exclude.jtx \ |
|
109 $(JAVA_TOOL_OPTIONS:%=-vmoption:%) \ |
|
110 $(JAVA_ARGS:%=-vmoption:%) \ |
|
111 $(TESTDIRS) |
|
112 |
|
113 # Bundle up the results |
|
114 $(JPRT_ARCHIVE_BUNDLE): FRC |
|
115 @rm -f $@ |
|
116 @mkdir -p $(@D) |
|
117 ( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . ) |
|
118 |
|
119 # Cleanup |
|
120 clean: |
|
121 rm -f -r $(TEST_OUTPUT_DIR) |
|
122 rm -f $(JPRT_ARCHIVE_BUNDLE) |
|
123 |
|
124 # Used to force a target rules to run |
|
125 FRC: |
|
126 |
|
127 # Phony targets (e.g. these are not filenames) |
|
128 .PHONY: all tests clean check |
|
129 |