source: trunk/openjdk/langtools/test/Makefile

Last change on this file was 2, checked in by dmik, 15 years ago

Imported OpenJDK 6 b19 sources from Oracle.

File size: 3.2 KB
Line 
1#
2# Makefile to run jtreg and any other tests
3#
4
5# Get OS/ARCH specifics
6OSNAME = $(shell uname -s)
7ifeq ($(OSNAME), SunOS)
8 PLATFORM = solaris
9 JT_PLATFORM = solaris
10 ARCH = $(shell uname -p)
11 ifeq ($(ARCH), i386)
12 ARCH=i586
13 endif
14endif
15ifeq ($(OSNAME), Linux)
16 PLATFORM = linux
17 JT_PLATFORM = linux
18 ARCH = $(shell uname -m)
19 ifeq ($(ARCH), i386)
20 ARCH=i586
21 endif
22endif
23ifeq ($(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
39endif
40
41# Root of this test area (important to use full paths in some places)
42TEST_ROOT := $(shell pwd)
43
44# Default bundle of all test results (passed or not)
45JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
46
47ifeq ($(PLATFORM), windows)
48 SLASH_JAVA = J:
49else
50 SLASH_JAVA = /java
51endif
52
53# Default JTREG to run
54ifdef JPRT_JTREG_HOME
55 JTREG_HOME = $(JPRT_JTREG_HOME)
56else
57 JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
58endif
59JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
60
61# Default JDK for JTREG
62ifdef JPRT_JAVA_HOME
63 JT_JAVA = $(JPRT_JAVA_HOME)
64else
65 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
66endif
67
68# Default JDK to test
69ifdef JPRT_IMPORT_PRODUCT_HOME
70 TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
71else
72 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.6.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
73endif
74
75TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
76
77# The test directories to run
78DEFAULT_TESTDIRS = .
79TESTDIRS = $(DEFAULT_TESTDIRS)
80
81# Root of all test results
82TEST_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH)
83
84# Default make rule
85all apt javac javadoc javah javap: clean check jtreg-tests $(JPRT_ARCHIVE_BUNDLE)
86 @echo "Testing completed successfully"
87
88# for use with JPRT -testrule
89all: TESTDIRS = .
90apt: TESTDIRS = tools/apt
91javac: TESTDIRS = tools/javac
92javadoc: TESTDIRS = tools/javadoc com/sun/javadoc
93javah: TESTDIRS = tools/javah
94javap: TESTDIRS = tools/javap
95
96# Check to make sure these directories exist
97check: $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
98
99# Run the tests
100jtreg-tests: FRC
101 @echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)"
102 @rm -f -r $(TEST_OUTPUT_DIR)/JTwork $(TEST_OUTPUT_DIR)/JTreport
103 @mkdir -p $(TEST_OUTPUT_DIR)
104 JT_JAVA=$(JT_JAVA) $(JTREG) \
105 -a -samevm -k:\!ignore -v:fail,error,nopass \
106 -r:$(TEST_OUTPUT_DIR)/JTreport \
107 -w:$(TEST_OUTPUT_DIR)/JTwork \
108 -jdk:$(TESTJAVA) \
109 -Xbootclasspath/p:$(TESTBOOTCLASSPATH) \
110 $(JAVA_ARGS:%=-vmoption:%) \
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 )
118
119# Bundle up the results
120$(JPRT_ARCHIVE_BUNDLE): FRC
121 @rm -f $@
122 @mkdir -p $(@D)
123 ( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . )
124
125# Cleanup
126clean:
127 rm -f -r $(TEST_OUTPUT_DIR)
128 rm -f $(JPRT_ARCHIVE_BUNDLE)
129
130# Used to force a target rules to run
131FRC:
132
133# Phony targets (e.g. these are not filenames)
134.PHONY: all tests clean check
135
Note: See TracBrowser for help on using the repository browser.