legacy-svn-scala/test/partest

78 lines
2.6 KiB
Bash
Executable File

#!/bin/sh
##############################################################################
# Scala test runner 2.7.0-final
##############################################################################
# (c) 2002-2008 LAMP/EPFL
#
# This is free software; see the distribution for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
##############################################################################
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true ;;
esac
# Finding the root folder for this Scala distribution
SOURCE=$0;
SCRIPT=`basename "$SOURCE"`;
while [ -h "$SOURCE" ]; do
SCRIPT=`basename "$SOURCE"`;
LOOKUP=`ls -ld "$SOURCE"`;
TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`;
if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then
SOURCE=${TARGET:-.};
else
SOURCE=`dirname "$SOURCE"`/${TARGET:-.};
fi;
done;
SCALA_HOME=`dirname "$SOURCE"`/..;
SCALA_HOME=`cd "$SCALA_HOME"; pwd`;
if $cygwin; then
SCALA_HOME=`cygpath --windows --short-name "$SCALA_HOME"`
SCALA_HOME=`cygpath --unix "$SCALA_HOME"`
fi
# Constructing the extension classpath
EXT_CLASSPATH=""
if [ -z "$EXT_CLASSPATH" ] ; then
if [ -f "$SCALA_HOME/lib/scala-partest.jar" ] ; then
for ext in `ls -d "$SCALA_HOME"/lib/*` ; do
if [ -z "$EXT_CLASSPATH" ] ; then
EXT_CLASSPATH="$ext"
else
EXT_CLASSPATH="$EXT_CLASSPATH:$ext"
fi
done
elif [ -f "$SCALA_HOME/build/pack/lib/scala-partest.jar" ] ; then
for lib in `echo "partest library compiler"`; do
ext="$SCALA_HOME/build/pack/lib/scala-$lib.jar"
if [ -z "$EXT_CLASSPATH" ] ; then
EXT_CLASSPATH="$ext"
else
EXT_CLASSPATH="$EXT_CLASSPATH:$ext"
fi
done
fi
fi
if $cygwin; then
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
format=mixed
else
format=windows
fi
SCALA_HOME=`cygpath --$format "$SCALA_HOME"`
EXT_CLASSPATH=`cygpath --path --$format "$EXT_CLASSPATH"`
fi
# Reminder: substitution ${JAVA_OPTS:=-Xmx256M -Xms16M} DO NOT work on Solaris
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx256M -Xms16M"
[ -n "$SCALAC_OPTS" ] || SCALAC_OPTS="-deprecation"
${JAVACMD:=java} $JAVA_OPTS -cp "$EXT_CLASSPATH" -Dscala.home="${SCALA_HOME}" -Dscalatest.javacmd="${JAVACMD}" -Dscalatest.java_options="${JAVA_OPTS}" -Dscalatest.scalac_options="${SCALAC_OPTS}" scala.tools.partest.nest.NestRunner "$@"