94N/A# The contents of this file are subject to the terms of the
94N/A# Common Development and Distribution License (the "License").
94N/A# You may not use this file except in compliance with the License.
94N/A# See the License for the specific language governing permissions
94N/A# and limitations under the License.
94N/A# When distributing Covered Code, include this CDDL HEADER in each
94N/A# If applicable, add the following below this CDDL HEADER, with the
94N/A# fields enclosed by brackets "[]" replaced with your own identifying
94N/A# information: Portions Copyright [yyyy] [name of copyright owner]
94N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
94N/A# Use is subject to license terms.
94N/A# Run the ksh93 minimum set of tests
94N/A# This may be simply a different sort order or a bug in the test suite.
94N/A# Currently under investigation.
94N/A# - These tests need a working system clock, otherwise they'll bite you.
94N/A# - The current list of locales was mainly composed to cover various encodings
94N/A# and all important markets based on suggestions by Sun's i18n team.
94N/A# - More locales should be tested here (via ON_KSH_TEST_LOCALES below).
94N/A# that is getting little bit more compliciated because these locales use
94N/A# ',' as decimal delimter. The best solution may be to wait for ksh93
94N/A# being integrated into
OS/Net and then change the test sequence to
94N/A# - Due to the timing sensitivity of some of the tests, these tests should
94N/A# be run on a quiet system with no other activity.
94N/A# ON_KSH_TEST_LOCALES can be overridden via
94N/A# $ export ON_KSH_TEST_LOCALES=<value> # before $ make install #
94N/AON_KSH_TEST_LOCALES = \
94N/A# ON_KSH_TEST_LIST can be overridden via
94N/A# $ export ON_KSH_TEST_LIST=<value> # before $ make install #
94N/AON_KSH_TEST_LIST = $(TESTSRC)/*.sh
# Flag to control whether we should make test failures non-fatal
ON_KSH_TEST_IGNORE_TESTFAILURE=false
# We must wait for other things in this subdir to finish before running
# the test suite, otherwise we may run into trouble that this activity
# may disturb the test suite run (resulting in weird "heisenbug"-like
print '# NOTE: Make sure your binaries in ROOT match your kernel!' ; \
printf "# which ksh='%s', ksh93='%s'\n" \
"$$(which ksh)" "$$(which ksh93)" ; \
if [[ "$$(isalist)" != ~(E)$(LIBSHELLMACH) ]] ; then \
"# ISA='%s' not available on this system, skipping tests...\n" \
print "# Libraries used:" ; \
LD_LIBRARY_PATH_64="$(ROOTLIB64)/" \
LD_LIBRARY_PATH_32="$(ROOTLIB)/" \
LD_LIBRARY_PATH="$(ROOTLIB64)/:$(ROOTLIB)/" \
print "# Running tests:" ; \
for test_lang in $(ON_KSH_TEST_LOCALES) ; do \
if [[ "$$(egrep "^$${test_lang}\$$" <<< "$${supported_locales}")" == "" ]] ; then \
"# Locale '%s' not supported, skipping tests...\n" \
(for test_item in $(ON_KSH_TEST_LIST) ; do \
"$${test_item}" == "$(TESTSRC)/
options.sh" ]] || \
$(ON_KSH_TEST_IGNORE_TESTFAILURE) && \
for mode in 'plain_script:-s' 'compiled_script:-c' ; do \
"## Running %s test: LANG='%s' script='%s', mode='%s'\n" \
"$$(basename "$${test_item}")" \
SHELL="$(SRC)
/cmd/ksh/$(LIBSHELLMACH)/ksh" \
LD_LIBRARY_PATH_64="$(ROOTLIB64)/" \
LD_LIBRARY_PATH_32="$(ROOTLIB)/" \
LD_LIBRARY_PATH="$(ROOTLIB64)/:$(ROOTLIB)/" ; \
"$${SHELL}" "$(TESTSRC)/shtests" -t "$${mode#*:}" \
LD_LIBRARY_PATH_64="$${LD_LIBRARY_PATH_64}" \
LD_LIBRARY_PATH_32="$${LD_LIBRARY_PATH_32}" \
LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}" \
SHCOMP="$(ROOTBIN)/shcomp" \
) 2>&1 | while read ; do \
printf "#\t%s\n" "$${REPLY}" ; \
[[ "$${test_output}" == ~(E)test.*passed\ \[\ [[:digit:]]*\ test.*\ 0\ errors\ \] ]] || \
(print "##--------> test failed" ; exit 1) \