alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (partest)

This example Scala source code file (partest) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

ext_classpath, ext_classpath, java_opts, java_opts, lookup, partest_debug, scala, scala_home, scala_home, scalac_opts, script, source, source, target

The Scala partest source code

#!/bin/sh

##############################################################################
# Scala test runner 2.8.0
##############################################################################
# (c) 2002-2011 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;

# see #2092
SCALA_HOME=`dirname "$SOURCE"`
SCALA_HOME=`cd "$SCALA_HOME"; pwd -P`
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 "$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

[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx1024M -Xms16M"
[ -n "$SCALAC_OPTS" ] || SCALAC_OPTS="-deprecation"

partestDebugStr=""
if [ ! -z "${PARTEST_DEBUG}" ] ; then
  partestDebugStr="-Dpartest.debug=${PARTEST_DEBUG}"
fi

${JAVACMD:=java} $JAVA_OPTS -cp "$EXT_CLASSPATH" ${partestDebugStr} -Dscala.home="${SCALA_HOME}" -Dpartest.javacmd="${JAVACMD}" -Dpartest.java_opts="${JAVA_OPTS}" -Dpartest.scalac_opts="${SCALAC_OPTS}" -Dpartest.javac_cmd="${JAVA_HOME}/bin/javac" scala.tools.partest.nest.NestRunner  "$@"

Other Scala examples (source code examples)

Here is a short list of links related to this Scala partest source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.