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