This page is no longer maintained — Please continue to the home page at www.scala-lang.org

tweaking partest

No replies
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

I checked in a partest patch. It's not 100% where I intend to get it
but like it says in the commit message, it was either commit or claw my
eyes out and run naked through a shopping mall.

The examples below all use ant, but personally I use the command line
most of the time, except when I'm joyously trying to debug ant itself.
Examples use ant to illustrate that (most) everything is handled
uniformly whether in ant or not.

See scala.tools.partest.PartestSpec if interested in the full list of
options/properties, which by virtue of scala magic are derived from a
single definition. (Most are in the help output you get if you run
partest with no args, but some are secret.)

Random top of the head examples, do not show entire range.

% ant -Dpartest.options="--res --grep Parser" test.suite

[partest] Executing test group (3 tests in res)
[partest] Started 3 workers with ~1 tests each.
[partest] [...]/res/bug743 [ OK ]
[partest] [...]/res/bug722 [ OK ]
[partest] [...]/res/bug831 [ OK ]

% ant -Dpartest.options="--dry-run --shootout --grep HashMap" test.suite

[partest] Executing test group (2 tests in shootout)
[partest] Started 1 workers with ~2 tests each.
[partest] >> [hash] generate test.scala from hash.scala, hash.scala.runner
[partest] >> [hash] scalac test.scala
[partest] >> [hash] java Test jvm
[partest] >> [hash] diff hash.check hash.log
[partest]
[partest] >> [hash2] generate test.scala from hash2.scala, hash2.scala.runner
[partest] >> [hash2] scalac test.scala
[partest] >> [hash2] java Test jvm
[partest] >> [hash2] diff hash2.check hash2.log

% ant -Dpartest.options="--dry-run --verbose --shootout --grep HashMap" test.suite

[partest] debug: Running 2/1214 tests: hash, hash2
[partest] Executing test group (2 tests in shootout)
[partest] Started 1 workers with ~2 tests each.
[partest] >> [hash] generate /scala/trunk/test/files/shootout/hash.obj/test.scala from /scala/trunk/test/files/shootout/hash.scala, /scala/trunk/test/files/shootout/hash.scala.runner
[partest] >> [hash] /scala/trunk/build/pack/bin/scalac -encoding ISO-8859-1 -classpath /scala/trunk/build/pack/lib/scala-library.jar:/scala/trunk/build/pack/lib/scala-compiler.jar:/scala/trunk/build/pack/lib/scala-partest.jar:/scala/trunk/lib/fjbg.jar:/scala/trunk/test/files/shootout/hash.obj -d /scala/trunk/test/files/shootout/hash.obj /scala/trunk/test/files/shootout/hash.obj/test.scala
[partest] >> [hash] java -Xms64M -Xmx768M -Xss768K -XX:MaxPermSize=96M -classpath /scala/trunk/build/pack/lib/scala-library.jar:/scala/trunk/build/pack/lib/scala-compiler.jar:/scala/trunk/build/pack/lib/scala-partest.jar:/scala/trunk/lib/fjbg.jar:/scala/trunk/test/files/shootout/hash.obj -Dscala.home=/scala/trunk/build/pack -Dpartest.lib=/scala/trunk/build/pack/lib/scala-library.jar -Djava.awt.headless=true -Duser.language=en -Duser.country=US -Dpartest.debug=false -Dpartest.verbose=true -Dpartest.output=/scala/trunk/test/files/shootout/hash.obj -Dpartest.cwd=/scala/trunk/test/files/shootout scala.tools.nsc.MainGenericRunner -usejavacp Test jvm
[partest] >> [hash] diff /scala/trunk/test/files/shootout/hash.check /scala/trunk/test/files/shootout/hash.log
[partest]
[partest] >> [hash2] generate /scala/trunk/test/files/shootout/hash2.obj/test.scala from /scala/trunk/test/files/shootout/hash2.scala, /scala/trunk/test/files/shootout/hash2.scala.runner
[partest] >> [hash2] /scala/trunk/build/pack/bin/scalac -d /scala/trunk/test/files/shootout/hash2.obj -encoding ISO-8859-1 -classpath /scala/trunk/build/pack/lib/scala-library.jar:/scala/trunk/build/pack/lib/scala-compiler.jar:/scala/trunk/build/pack/lib/scala-partest.jar:/scala/trunk/lib/fjbg.jar:/scala/trunk/test/files/shootout/hash2.obj /scala/trunk/test/files/shootout/hash2.obj/test.scala
[partest] >> [hash2] java -Xms64M -Xmx768M -Xss768K -XX:MaxPermSize=96M -classpath /scala/trunk/build/pack/lib/scala-library.jar:/scala/trunk/build/pack/lib/scala-compiler.jar:/scala/trunk/build/pack/lib/scala-partest.jar:/scala/trunk/lib/fjbg.jar:/scala/trunk/test/files/shootout/hash2.obj -Dscala.home=/scala/trunk/build/pack -Dpartest.lib=/scala/trunk/build/pack/lib/scala-library.jar -Djava.awt.headless=true -Duser.language=en -Duser.country=US -Dpartest.debug=false -Dpartest.verbose=true -Dpartest.output=/scala/trunk/test/files/shootout/hash2.obj -Dpartest.cwd=/scala/trunk/test/files/shootout scala.tools.nsc.MainGenericRunner -usejavacp Test jvm
[partest] >> [hash2] diff /scala/trunk/test/files/shootout/hash2.check /scala/trunk/test/files/shootout/hash2.log
[partest]
[partest]
[partest] 2 tests would be run.

% ant -Dpartest.show-diff=true -Dpartest.run=true -Dpartest.scalacopts="-Yfatal-warnings" test.suite

...
[partest] [...]/run/arrayclone.scala [ OK ]
[partest] [...]/run/stringbuilder.scala [ OK ]
[partest] [...]/run/t1718.scala [ OK ]
[partest] [...]/run/bug2354.scala [ OK ]
[partest] [...]/run/caseclasses.scala [ FAILED ]
[partest] 1,3c1,2
[partest] < OK
[partest] < creating C(hi)
[partest] < OK
[partest] ---
[partest] > error: there were deprecation warnings; re-run with -deprecation for details
[partest] > one error found

% ant -Dpartest.options="--trace test/files/pos/t294/" test.suite
[partest] Executing test group (1 tests in pos)
[partest] Started 1 workers with ~1 tests each.
[partest] >> [t294] javac -d t294.obj Ann.java Ann2.java
[partest] >> [t294] scalac Test_1.scala
[partest] >> [t294] scalac Test_2.scala
[partest] [...]/pos/t294 [ OK ] (#0 100%)
[partest]
[partest] All 1 tests were successful (elapsed time: 00:00:06)

% ant -Dpartest.srcdir=pending -Dpartest.buildmanager=true test.suite

[partest] Source directory is: /scala/trunk/test/pending
[partest] Selected categories: buildmanager
[partest] Executing test group (1 tests in buildmanager)
[partest] Started 1 workers with ~1 tests each.
[partest] [...]/buildmanager/t2443 [ FAILED ]
[partest]
[partest] 1 of 1 tests failed (elapsed time: 00:00:01)

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland