Makefile revision 0
#
# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
#
# Makefile to run jtreg
#
else
else
else
# Default bundle of all test results (passed or not)
# Default home for JTREG
else
# Default JTREG to run
# Root of this test area
# Default JDK to test
# The test directories to run
TESTDIRS = $(DEFAULT_TESTDIRS)
# Files that hold total passed and failed counts (passed==0 is bad)
# Root of all test results
# Test results for one test directory
# Temp files used by this Makefile
# JTREG options (different for 2.1.6 and 3.2.2_01)
JTREG_COMMON_OPTIONS = -r:$(JTREG_TEST_REPORT_DIR) \
-w:$(JTREG_TEST_WORK_DIR) \
-automatic \
# Default make rule
# Chaeck to make sure these directories exist
# Prime the test run
@rm -f -r $(JTREG_TOTALS_DIR)
@mkdir -p $(JTREG_TOTALS_DIR)
@echo "0" > $(JTREG_FAILED)
@echo "0" > $(JTREG_PASSED)
# Run the tests and determine the 'make' command exit status
echo "JTREG FAILED"; \
exit 1; \
else \
echo "JTREG PASSED"; \
exit 0; \
fi
# Just make sure these directires exist
@if [ ! -d $@ ] ; then \
echo "ERROR: Directory $@ does not exist"; \
exit 1; \
fi
# Make sure this file exists
@if [ ! -f $@ ] ; then \
echo "ERROR: File $@ does not exist"; \
exit 1; \
fi
# Process each test directory one by one, this rule always completes.
# Note that the use of 'tee' tosses the jtreg process exit status, this
# is as expected because even if jtreg fails, we need to save the
# output. So we update the JTREG_PASSED and JTREG_FAILED count files.
# Note that missing the 'results:' line in the last few lines of output
# will indicate a failure (or a bump by one of the JTREG_FAILED file.
# Note that passed: 0 or no passed: indication means a failure.
# Note that any indication of the word 'failed' indicates failure.
# Ultimately if the contents of JTREG_FAILED is not 0, we have failed
# tests, and if the contents of JTREG_PASSED is 0, we consider that a
# failure.
@if [ ! -d $@ ] ; then \
echo "ERROR: Directory $@ does not exist"; \
exit 1; \
fi
@echo "---------------------------------------------------"
@rm -f -r $(JTREG_TEST_OUTPUT_DIR)
@mkdir -p $(JTREG_TEST_OUTPUT_DIR)
@mkdir -p $(JTREG_TEST_WORK_DIR)
@mkdir -p $(JTREG_TEST_REPORT_DIR)
@mkdir -p $(JTREG_TEST_TEMP_DIR)
@echo "Testing $@"
echo "Assume we are using jtreg 3.2.2_01 or newer"; \
else \
echo "Assume we are using jtreg 2.1.6"; \
fi
@echo "---------------------------------------------------"
@echo "Extracting passed and failed counts from jtreg output"
> $(JTREG_TEMP_PASSED)
echo "ERROR: No passed indication in results"; \
echo "ERROR: Passed count appears to be 0"; \
echo "No indication anything failed"; \
> $(JTREG_PASSED); \
else \
> $(JTREG_TEMP_FAILED); \
echo "ERROR: Failed pattern but no failed count in results"; \
echo "ERROR: Failed count is 0, did something failed or not?"; \
else \
> $(JTREG_FAILED); \
fi; \
fi
@echo "---------------------------------------------------"
@echo "Summary: "
@if [ -f $(JTREG_TEST_SUMMARY) ] ; then \
cat $(JTREG_TEST_SUMMARY) ; \
else \
fi
@echo "---------------------------------------------------"
# Cleanup
rm -f -r $(JTREG_ALL_OUTPUT_DIR)
rm -f $(JPRT_ARCHIVE_BUNDLE)
FRC: