hotspot/test/Makefile
author duke
Wed, 05 Jul 2017 16:38:26 +0200
changeset 738 7c47c40d4bd5
parent 1 489c9b5090e2
child 1132 915051915ce9
permissions -rw-r--r--
Added tag jdk7-b30 for changeset bee4731164a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# Makefile to run jtreg
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
OSNAME = $(shell uname -s)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
ifeq ($(OSNAME), SunOS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
  PLATFORM = solaris
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  JCT_PLATFORM = solaris
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  ARCH = $(shell uname -p)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  ifeq ($(ARCH), i386)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    ARCH=i586
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
ifeq ($(OSNAME), Linux)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  PLATFORM = linux
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  JCT_PLATFORM = linux
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  ARCH = $(shell uname -m)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  ifeq ($(ARCH), i386)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    ARCH=i586
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
ifeq ($(OSNAME), Windows_NT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  PLATFORM = windows
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  JCT_PLATFORM = win32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    ARCH=ia64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
      ARCH=x64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
      ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
        ARCH=x64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
      else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
        ARCH=i586
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
      endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
# Default bundle of all test results (passed or not)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
JPRT_ARCHIVE_BUNDLE=$(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# Default home for JTREG
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
ifeq ($(PLATFORM), windows)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  JT_HOME = J:/svc/jct-tools3.2.2_01
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  JT_HOME = /java/svc/jct-tools3.2.2_01
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
# Default JTREG to run
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
JTREG = $(JT_HOME)/$(JCT_PLATFORM)/bin/jtreg
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
# Root of this test area
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
TEST_ROOT := $(shell pwd)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
# Default JDK to test
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
JAVA_HOME = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
# The test directories to run
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
DEFAULT_TESTDIRS = serviceability
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
TESTDIRS = $(DEFAULT_TESTDIRS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
# Files that hold total passed and failed counts (passed==0 is bad)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
JTREG_TOTALS_DIR = $(TEST_ROOT)/JTREG_TOTALS_$(PLATFORM)_$(ARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
JTREG_FAILED = $(JTREG_TOTALS_DIR)/failed_count
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
JTREG_PASSED = $(JTREG_TOTALS_DIR)/passed_count
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
# Root of all test results
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
JTREG_ALL_OUTPUT_DIRNAME = JTREG_OUTPUT_$(PLATFORM)_$(ARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
JTREG_ALL_OUTPUT_DIR = $(TEST_ROOT)/$(JTREG_ALL_OUTPUT_DIRNAME)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
# Test results for one test directory
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
JTREG_TEST_OUTPUT_DIR = $(JTREG_ALL_OUTPUT_DIR)/$@
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
JTREG_TEST_REPORT_DIR = $(JTREG_TEST_OUTPUT_DIR)/JTreport
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
JTREG_TEST_WORK_DIR   = $(JTREG_TEST_OUTPUT_DIR)/JTwork
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
JTREG_TEST_SUMMARY    =	$(JTREG_TEST_REPORT_DIR)/summary.txt
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
# Temp files used by this Makefile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
JTREG_TEST_TEMP_DIR   = $(JTREG_ALL_OUTPUT_DIR)/$@/temp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
JTREG_TEMP_PASSED     = $(JTREG_TEST_TEMP_DIR)/passed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
JTREG_TEMP_FAILED     = $(JTREG_TEST_TEMP_DIR)/failed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
JTREG_TEMP_OUTPUT     = $(JTREG_TEST_TEMP_DIR)/output
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
JTREG_TEMP_RESULTS    = $(JTREG_TEST_TEMP_DIR)/results
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
# JTREG options (different for 2.1.6 and 3.2.2_01)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
JTREG_COMMON_OPTIONS = -r:$(JTREG_TEST_REPORT_DIR) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
                       -w:$(JTREG_TEST_WORK_DIR) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
                       -testjdk:$(JAVA_HOME) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
                       -automatic \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
	               -verbose:all
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
JTREG_216_OPTIONS = $(JTREG_COMMON_OPTIONS) $@ $(JAVA_ARGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
JTREG_322_OPTIONS = $(JTREG_COMMON_OPTIONS) $(JAVA_ARGS:%=-vmoption:%) $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
# Default make rule
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
all: clean check tests
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
# Chaeck to make sure these directories exist
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
check: $(JT_HOME) $(JAVA_HOME) $(JTREG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
# Prime the test run
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
primecounts: FRC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
	@rm -f -r $(JTREG_TOTALS_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
	@mkdir -p $(JTREG_TOTALS_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
	@echo "0" > $(JTREG_FAILED)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
	@echo "0" > $(JTREG_PASSED)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
# Run the tests and determine the 'make' command exit status
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
#   Ultimately we determine the make exit code based on the passed/failed count
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
tests: primecounts $(TESTDIRS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
	@echo "JTREG TOTAL: passed=`cat $(JTREG_PASSED)` failed=`cat $(JTREG_FAILED)`"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
	zip -q -r $(JPRT_ARCHIVE_BUNDLE) $(JTREG_ALL_OUTPUT_DIRNAME)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
	@if [ `cat $(JTREG_FAILED)` -ne 0 -o \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
	     `cat $(JTREG_PASSED)` -le 0 ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
	  echo "JTREG FAILED"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
	  exit 1; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
	else \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
	  echo "JTREG PASSED"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
	  exit 0; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
# Just make sure these directires exist
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
$(JT_HOME) $(JAVA_HOME): FRC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
	@if [ ! -d $@ ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
	    echo "ERROR: Directory $@ does not exist"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
	    exit 1; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
# Make sure this file exists
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
$(JTREG): FRC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
	@if [ ! -f $@ ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
	    echo "ERROR: File $@ does not exist"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
	    exit 1; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
# Process each test directory one by one, this rule always completes.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
#    Note that the use of 'tee' tosses the jtreg process exit status, this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
#    is as expected because even if jtreg fails, we need to save the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
#    output. So we update the JTREG_PASSED and JTREG_FAILED count files.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
#    Note that missing the 'results:' line in the last few lines of output
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
#    will indicate a failure (or a bump by one of the JTREG_FAILED file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
#    Note that passed: 0 or no passed: indication means a failure.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
#    Note that any indication of the word 'failed' indicates failure.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
#    Ultimately if the contents of JTREG_FAILED is not 0, we have failed 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
#    tests, and if the contents of JTREG_PASSED is 0, we consider that a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
#    failure.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
$(TESTDIRS):  FRC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
	@if [ ! -d $@ ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
	    echo "ERROR: Directory $@ does not exist"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
	    exit 1; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
	@echo "---------------------------------------------------"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
	@rm -f -r $(JTREG_TEST_OUTPUT_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
	@mkdir -p $(JTREG_TEST_OUTPUT_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
	@mkdir -p $(JTREG_TEST_WORK_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
	@mkdir -p $(JTREG_TEST_WORK_DIR)/scratch
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
	@mkdir -p $(JTREG_TEST_REPORT_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
	@mkdir -p $(JTREG_TEST_TEMP_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
	@echo "Testing $@"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
	@echo "Using JAVA_HOME=$(JAVA_HOME)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
	@echo "Using JAVA_ARGS=$(JAVA_ARGS)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
	@if [ "`$(JTREG) -help 2>&1 | fgrep -- -vmoption`" != "" ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
	  echo "Assume we are using jtreg 3.2.2_01 or newer"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
	  echo "$(JTREG) $(JTREG_322_OPTIONS)"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
	  $(JTREG) $(JTREG_322_OPTIONS) 2>&1 | tee $(JTREG_TEMP_OUTPUT) ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
	else \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
	  echo "Assume we are using jtreg 2.1.6"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
	  echo "$(JTREG) $(JTREG_216_OPTIONS)"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
	  $(JTREG) $(JTREG_216_OPTIONS) 2>&1 | tee $(JTREG_TEMP_OUTPUT) ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
	@echo "---------------------------------------------------"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
	@echo "Extracting passed and failed counts from jtreg output"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
	@tail -10 $(JTREG_TEMP_OUTPUT) | fgrep -i 'results:' | \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
	       tail -1 | tee $(JTREG_TEMP_RESULTS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
	@sed -e 's@.*\ passed:\ \([1-9][0-9]*\).*@\1@' $(JTREG_TEMP_RESULTS) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
	       > $(JTREG_TEMP_PASSED)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
	@if [ "`cat $(JTREG_TEMP_PASSED)`" = "" ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
	  echo "ERROR: No passed indication in results"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
	  expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
	elif [ `cat $(JTREG_TEMP_PASSED)` -le 0 ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
	  echo "ERROR: Passed count appears to be 0"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
	  expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
	elif [ "`fgrep -i failed $(JTREG_TEMP_RESULTS)`" = "" ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
	  echo "No indication anything failed"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
	  expr `cat $(JTREG_PASSED)` '+' `cat $(JTREG_TEMP_PASSED)` \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
		> $(JTREG_PASSED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
	else \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
	  sed -e 's@.*\ failed:\ \([1-9][0-9]*\).*@\1@' $(JTREG_TEMP_FAILED) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
		> $(JTREG_TEMP_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
	  if [ "`cat $(JTREG_TEMP_FAILED)`" = "" ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
	    echo "ERROR: Failed pattern but no failed count in results"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
	    expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
	  elif [ `cat $(JTREG_TEMP_FAILED)` -le 0 ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
	    echo "ERROR: Failed count is 0, did something failed or not?"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
	    expr `cat $(JTREG_FAILED)` '+' 1 > $(JTREG_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
	  else \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
	    expr `cat $(JTREG_FAILED)` '+' `cat $(JTREG_TEMP_FAILED)` \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
		  > $(JTREG_FAILED); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
	  fi; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
	@echo "---------------------------------------------------"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
	@echo "Summary: "
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
	@if [ -f $(JTREG_TEST_SUMMARY) ] ; then \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
	  cat $(JTREG_TEST_SUMMARY) ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
	else \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
	  echo "ERROR: Missing $(JTREG_TEST_SUMMARY)"; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
	@echo "---------------------------------------------------"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
# Cleanup
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
clean:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
	rm -f -r $(JTREG_ALL_OUTPUT_DIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
	rm -f $(JPRT_ARCHIVE_BUNDLE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
FRC:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239