|
1 # |
|
2 # Makefile to run jtreg |
|
3 # |
|
4 |
|
5 # Get OS/ARCH specifics |
|
6 OSNAME = $(shell uname -s) |
|
7 ifeq ($(OSNAME), SunOS) |
|
8 PLATFORM = solaris |
|
9 JCT_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 JCT_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 JCT_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 JT_HOME = J:/svc/jct-tools3.2.2_02 |
|
50 JTREG_KEY_OPTION=-k:!ignore |
|
51 else |
|
52 JT_HOME = /java/svc/jct-tools3.2.2_02 |
|
53 JTREG_KEY_OPTION=-k:\!ignore |
|
54 endif |
|
55 |
|
56 # Default JTREG to run |
|
57 JTREG = $(JT_HOME)/$(JCT_PLATFORM)/bin/jtreg |
|
58 |
|
59 # Default JDK to test |
|
60 JAVA_HOME = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH) |
|
61 |
|
62 # The test directories to run |
|
63 DEFAULT_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof |
|
64 TESTDIRS = $(DEFAULT_TESTDIRS) |
|
65 |
|
66 # Root of all test results |
|
67 JTREG_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH) |
|
68 |
|
69 # Export this setting and pass it in. |
|
70 #JAVA_TOOL_OPTIONS = -Djava.awt.headless=true |
|
71 #export JAVA_TOOL_OPTIONS |
|
72 |
|
73 # Default make rule |
|
74 all: clean check tests $(JPRT_ARCHIVE_BUNDLE) |
|
75 @echo "Testing completed successfully" |
|
76 |
|
77 # Chaeck to make sure these directories exist |
|
78 check: $(JT_HOME) $(JAVA_HOME) $(JTREG) |
|
79 |
|
80 # Run the tests |
|
81 tests: FRC |
|
82 @echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)" |
|
83 @rm -f -r $(JTREG_OUTPUT_DIR) |
|
84 @mkdir -p $(JTREG_OUTPUT_DIR) |
|
85 $(JTREG) -a -v:fail,error \ |
|
86 $(JTREG_KEY_OPTION) \ |
|
87 -r:$(JTREG_OUTPUT_DIR)/JTreport \ |
|
88 -w:$(JTREG_OUTPUT_DIR)/JTwork \ |
|
89 -jdk:$(JAVA_HOME) \ |
|
90 $(JAVA_TOOL_OPTIONS:%=-vmoption:%) \ |
|
91 $(JAVA_ARGS:%=-vmoption:%) \ |
|
92 $(TESTDIRS) |
|
93 |
|
94 # Bundle up the results |
|
95 $(JPRT_ARCHIVE_BUNDLE): FRC |
|
96 @rm -f $@ |
|
97 @mkdir -p $(@D) |
|
98 ( cd $(JTREG_OUTPUT_DIR) && zip -q -r $@ . ) |
|
99 |
|
100 # Cleanup |
|
101 clean: |
|
102 rm -f -r $(JTREG_OUTPUT_DIR) |
|
103 rm -f $(JPRT_ARCHIVE_BUNDLE) |
|
104 |
|
105 # Used to force a target rules to run |
|
106 FRC: |
|
107 |
|
108 # Phony targets (e.g. these are not filenames) |
|
109 .PHONY: all tests clean check |
|
110 |