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