ICU-8755 updates to uconfigtest script

X-SVN-Rev: 30512
This commit is contained in:
Steven R. Loomis 2011-08-15 23:39:52 +00:00
parent 1cfc79d829
commit da5e19bcec
2 changed files with 70 additions and 26 deletions

2
.gitignore vendored
View file

@ -946,6 +946,8 @@ tools/multi/proj/chello/out
tools/multi/proj/provider/Makefile.local
tools/multi/proj/provider/out
tools/multi/tmp
tools/release/c/uconfigtest
tools/release/c/uconfigtest.local
tools/release/java/APIChangeReport*
tools/release/java/Makefile.local
tools/release/java/classes

View file

@ -1,7 +1,6 @@
#!/bin/sh
# Exhaust(ive, ing) (Mean, Multi) (Test, Trouble)
# Copyright (c) 2002-2011 IBM All Rights Reserved
#
# Builds ICU a whole lotta times and with different options
# Set the options below and execute this script with the shell.
@ -14,6 +13,8 @@
# You can also use the uconfigtest.local file to override the BUILD_DIR
# and ICUPLATFORM variables.
# It can be handy to run 'tail -F uconfigtest/stats' in another window to see where things are.
#------------------- Find full path names -----------------------
JOPT=-j2
@ -30,6 +31,14 @@ S=$(pwd)
# Build root - tools/release/c/uconfigtest
BUILD_DIR=${BUILD_DIR:-${S}/uconfigtest}
FAILS=${BUILD_DIR}/fails
STATS=${BUILD_DIR}/stats
>${FAILS}
>${STATS}
echo >> ${STATS}
echo >> ${STATS}
# the runConfigureICU platform name
ICUPLATFORM=${ICUPLATFORM:-Linux}
@ -49,17 +58,18 @@ ICU=$(dirname $(dirname $(dirname ${S})))/icu
SRC_DIR=${SRC_DIR:-${ICU}/source}
# ------------ End of config variables
# Prepare uconfig.h
UCONFIG_H=$SRC_DIR/common/unicode/uconfig.h
if grep -q myconfig.h $UCONFIG_H ;
UCONFIG_LOCAL_H=uconfig_local.h
UCONFIG_USE_LOCAL=UCONFIG_USE_LOCAL
# Prepare uconfig.h
if grep -q ${UCONFIG_LOCAL_H} $UCONFIG_H ;
then
echo "# $UCONFIG_H already contains our patch, no change"
else
mv $UCONFIG_H ${UCONFIG_H}.orig
cat > $UCONFIG_H <<EOF
#if defined(IN_UCONFIGTEST)
#include "myconfig.h"
#if defined(${UCONFIG_USE_LOCAL})
#include ${UCONFIG_LOCAL_H}"
#endif
/* for uconfigtest.sh - you may REMOVE above this line */
/* ----------------------------------------------------------- */
@ -86,11 +96,14 @@ ban()
echo
echo " build to ${BUILD_DIR}/${NAME} and install in ${BUILD_DIR}/I${NAME} "
echo
echo "${NAME} ---------------------------------------" >> ${STATS}
}
# Clean up the old tree before building again
clean()
{
stats clean
echo cleaning ${BUILD_DIR}/${NAME} and ${BUILD_DIR}/I${NAME}
rm -rf ${BUILD_DIR}/I${NAME} ${BUILD_DIR}/${NAME}
mkdir -p ${BUILD_DIR}/${NAME}
@ -99,12 +112,13 @@ clean()
# Run configure with the appropriate options (out of source build)
config()
{
stats config
mkdir -p ${BUILD_DIR}/${NAME} 2>/dev/null
cd ${BUILD_DIR}/${NAME}
mkdir emtinc 2>/dev/null
# myconfig.h
cat > emtinc/myconfig.h <<EOF
cat > emtinc/${UCONFIG_LOCAL_H} <<EOF
/* NAME=${NAME} */
/* UCONFIGS=${UCONFIGS} */
/* CPPFLAGS=${CPPFLAGS} */
@ -114,16 +128,31 @@ config()
EOF
for what in `echo $UCONFIGS`;
do
echo "#define UCONFIG_${what} 1" >> emtinc/myconfig.h
echo "#define UCONFIG_${what} 1" >> emtinc/${UCONFIG_LOCAL_H}
done
cat >> emtinc/myconfig.h <<EOF
cat >> emtinc/${UCONFIG_LOCAL_H} <<EOF
#endif
EOF
CPPFLAGS="${CPPFLAGS} -DIN_UCONFIGTEST -I${BUILD_DIR}/${NAME}/emtinc"
CPPFLAGS="${CPPFLAGS} -D${UCONFIG_USE_LOCAL} -I${BUILD_DIR}/${NAME}/emtinc"
echo "CPPFLAGS=\"$CPPFLAGS\" Configure $COPTS --srcdir=$SRC_DIR"
$SRC_DIR/runConfigureICU ${ICUPLATFORM} $COPTS --prefix=${BUILD_DIR}/I${NAME} --srcdir=$SRC_DIR 2>&1 > ${BUILD_DIR}/${NAME}/config.out
}
stats()
{
STATUS="${NAME}: ${1} "`date`
echo ${STATUS} >> ${STATS}
echo "*** ${NAME} ********* ${1} ************* "
}
fail()
{
FAILURE="error: ${BUILD_DIR}/${NAME}: ${1} "`date`
echo ${FAILURE} >> ${FAILS}
echo ${FAILURE} >> ${STATS}
echo "${FAILURE}"
}
# Do an actual build
bld()
{
@ -131,17 +160,23 @@ bld()
##*## every line:
##*## . . . 2>&1 | tee -a ./bld.log | sed -e "s/^/${NAME}: /"
cd ${BUILD_DIR}/${NAME}
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.all make -k ${JOPT} all
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.install make -k install INSTALL_DATA='ln -svf '
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.il make -k install-local
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.chk make -k ${JOPT} check INTLTEST_OPTS=-w CINTLTST_OPTS=-w
PATH=${BUILD_DIR}/I${NAME}/bin:$PATH make -C ${BUILD_DIR}/${NAME}/test/hdrtst/ check
stats "make -k ${JOPT} all ${1}"
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.all make -k ${JOPT} all ${1} DEPS= || fail make
stats install
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.install make -k install ${1} DEPS= INSTALL_DATA='ln -svf ' || fail install
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.il make -k install-local ${1} DEPS= || fail install-local
stats check
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.chk make -k ${JOPT} check ${1} INTLTEST_OPTS=-w CINTLTST_OPTS=-w DEPS= || fail check
stats hdrtst
PATH=${BUILD_DIR}/I${NAME}/bin:$PATH make -k -C ${BUILD_DIR}/${NAME}/test/hdrtst/ DEPS= check || fail hdrtst
}
# Do a complete cycle for a run
# arg: opts to build
doit()
{
ban ; clean ; config ; bld
ban ; clean ; config ; bld ${1}
}
# Set up the variables for convenience
@ -165,6 +200,15 @@ NO_ALL="$NO_MST $NO_SVC"
# Now, come the actual test runs
# Each one sets a NAME, and CPPFLAGS or other flags, and calls doit
######################
# DEFAULT
export NAME=DEFAULT
export UCONFIGS=""
export CPPFLAGS=""
doit
USE_PREBUILT_DATA="ICUDATA_SOURCE_ARCHIVE=`echo ${BUILD_DIR}/DEFAULT/data/out/tmp/*.dat`"
######################
######################
# NO_MST
export NAME=NO_MST
@ -178,7 +222,7 @@ doit
export NAME=NO_RGX
export UCONFIGS="$NO_RGX"
export CPPFLAGS=""
doit
doit ${USE_PREBUILT_DATA}
######################
######################
@ -218,7 +262,7 @@ doit
export NAME=NO_FIO
export UCONFIGS="$NO_FIO"
export CPPFLAGS=""
doit
doit ${USE_PREBUILT_DATA}
######################
######################
@ -269,14 +313,6 @@ export CPPFLAGS=""
doit
######################
######################
# DEFAULT
export NAME=DEFAULT
export UCONFIGS=""
export CPPFLAGS=""
doit
######################
NAME=done
ban
@ -285,3 +321,9 @@ echo "There were errors if the following grep finds anything."
echo "grep status ${BUILD_DIR}/times/*"
grep status ${BUILD_DIR}/times/*
if [ -s ${FAILS} ];
then
echo "Failures: "
cat ${FAILS}
fi