From 473a1692abf4d64e5df81cd19be214fe5bfa06ec Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 19 Jul 2013 17:33:17 -0700 Subject: Move partest to https://github.com/scala/scala-partest As partest is now resolved from maven, `test/partest` uses `ant test.suite.init` to determine the classpath (serialized to build/pack/partest.properties) that's necessary to run `scala.tools.partest.nest.ConsoleRunner`. Thus, partest gets exactly the same classpath, whether run from the command line through `test/partest` or via `ant test`. The version of partest we're using is specified by properties defined in versions.properties (formerly `starr.number`). Currently, we're using: ``` scala.binary.version=2.11.0-M4 partest.version.number=1.0-RC3 ``` NOTES: - The version of Scala being tested must be backwards binary compatible with the version of Scala that was used to compile partest. - Once 2.11 goes final, `scala.binary.version=2.11`, and `starr.version=2.11.0`. - Need scalacheck on classpath for test/partest scalacheck tests. - Removed atrophied ant tests (haven't been run/changed for at least two years I checked 81d659141a as a "random" sample). - Removed scalacheck. It's resolved as a partest dependency. - For now, use a locally built scalap - Kept the trace macro in the main repo (partest-extras) - New targets for faster pr validation: test-core-opt, test-stab-opt - Reused partest eclipse/intellij project to partest-extras (note: the partest dependency is hard-coded) --- test/partest | 57 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'test/partest') diff --git a/test/partest b/test/partest index 8d94facba3..f396459c6d 100755 --- a/test/partest +++ b/test/partest @@ -46,29 +46,40 @@ if $cygwin; then 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 "scala-partest scala-library scala-parser-combinators scala-xml scala-reflect scala-compiler diffutils"`; do - ext="$SCALA_HOME/build/pack/lib/$lib.jar" - if [ -z "$EXT_CLASSPATH" ] ; then - EXT_CLASSPATH="$ext" - else - EXT_CLASSPATH="$EXT_CLASSPATH:$ext" - fi - done +# Let ant construct the classpath used to run partest (downloading partest from maven if necessary) +# PARTEST_CLASSPATH="" +if [ -z "$PARTEST_CLASSPATH" ] ; then + if [ ! -f "$SCALA_HOME/build/pack/partest.properties" ] ; then + (cd "$SCALA_HOME" && ant -q test.suite.init) # builds pack, downloads partest and writes classpath to build/pack/partest.properties fi + + PARTEST_CLASSPATH=$( cat "$SCALA_HOME/build/pack/partest.properties" | grep partest.classpath | sed -e 's/\\:/:/g' | cut -f2- -d= ) + + # sanity check, disabled to save time + # $( javap -classpath $PARTEST_CLASSPATH scala.tools.partest.nest.NestRunner &> /dev/null ) || unset PARTEST_CLASSPATH fi +# if [ -z "$PARTEST_CLASSPATH" ] ; then +# if [ -f "$SCALA_HOME/lib/scala-partest.jar" ] ; then +# for ext in "$SCALA_HOME"/lib/* ; do +# if [ -z "$PARTEST_CLASSPATH" ] ; then +# PARTEST_CLASSPATH="$ext" +# else +# PARTEST_CLASSPATH="$PARTEST_CLASSPATH:$ext" +# fi +# done +# elif [ -f "$SCALA_HOME/build/pack/lib/scala-partest.jar" ] ; then +# for lib in `echo "scala-partest scala-library scala-parser-combinators scala-xml scala-reflect scala-compiler diffutils"`; do +# ext="$SCALA_HOME/build/pack/lib/$lib.jar" +# if [ -z "$PARTEST_CLASSPATH" ] ; then +# PARTEST_CLASSPATH="$ext" +# else +# PARTEST_CLASSPATH="$PARTEST_CLASSPATH:$ext" +# fi +# done +# fi +# fi + # Locate a javac command # Try: JAVA_HOME, sibling to specific JAVACMD, or PATH # Don't fail if there is no javac, since not all tests require it. @@ -101,7 +112,7 @@ if $cygwin; then JAVAC_CMD=`cygpath --$format "$JAVAC_CMD"` fi SCALA_HOME=`cygpath --$format "$SCALA_HOME"` - EXT_CLASSPATH=`cygpath --path --$format "$EXT_CLASSPATH"` + PARTEST_CLASSPATH=`cygpath --path --$format "$PARTEST_CLASSPATH"` fi # last arg wins, so if JAVA_OPTS already contains -Xmx or -Xms the @@ -123,7 +134,7 @@ fi # be quoted: otherwise an empty string will appear as a command line # argument, and java will think that is the program to run. "${JAVACMD:=java}" \ - $JAVA_OPTS -cp "$EXT_CLASSPATH" \ + $JAVA_OPTS -cp "$PARTEST_CLASSPATH" \ ${partestDebugStr} \ ${color_opts} \ -Dfile.encoding=UTF-8 \ @@ -132,4 +143,4 @@ fi -Dpartest.java_opts="${JAVA_OPTS}" \ -Dpartest.scalac_opts="${SCALAC_OPTS}" \ -Dpartest.javac_cmd="${JAVAC_CMD}" \ - scala.tools.partest.nest.NestRunner "$@" + scala.tools.partest.nest.ConsoleRunner "$@" -- cgit v1.2.3