Skip to content

Commit d301a86

Browse files
committed
Merge pull request scala#2353 from adriaanm/cooler-couleurs-re3
Cooler couleurs take 3
2 parents 7bb981a + 0d95443 commit d301a86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1545
-1597
lines changed

build.xml

100644100755
Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<project name="sabbus" default="build" xmlns:artifact="urn:maven-artifact-ant">
4+
<include file="test/build-partest.xml" as="partest"/>
5+
46
<description>
57
SuperSabbus for Scala core, builds the scala library and compiler. It can also package it as a simple distribution, tests it for stable bootstrapping and against the Scala test suite.
68
</description>
@@ -135,7 +137,7 @@ TODO:
135137
<property name="dists.dir" value="${basedir}/dists"/>
136138

137139
<property name="copyright.string" value="Copyright 2002-2013, LAMP/EPFL"/>
138-
<property name="partest.version.number" value="0.9.2"/>
140+
<property name="partest.version.number" value="0.9.3"/>
139141

140142
<!-- These are NOT the flags used to run SuperSabbus, but the ones written
141143
into the script runners created with scala.tools.ant.ScalaTool -->
@@ -530,7 +532,7 @@ TODO:
530532
<path id="quick.partest.build.path">
531533
<path refid="quick.scalap.build.path"/>
532534
<path refid="partest.extras.classpath"/>
533-
<pathelement location="${build-quick.dir}/classes/repl"/>
535+
<pathelement location="${build-quick.dir}/classes/repl"/>
534536
<pathelement location="${scalacheck.jar}"/>
535537
</path>
536538

@@ -650,11 +652,15 @@ TODO:
650652
<path refid="partest.extras.classpath"/>
651653
</path>
652654

655+
<!-- obsolete? -->
656+
<!-- TODO - segregate swing tests (there can't be many) -->
657+
<!--
653658
<path id="partest.build.path">
654659
<path refid="pack.compiler.path"/>
655660
<fileset dir="${partest.dir}/files/lib" includes="*.jar" />
656-
<pathelement location="${pack.dir}/lib/scala-swing.jar"/> <!-- TODO - segregate swing tests (there can't be many) -->
661+
<pathelement location="${pack.dir}/lib/scala-swing.jar"/>
657662
</path>
663+
-->
658664

659665
<path id="test.osgi.compiler.build.path">
660666
<pathelement location="${test.osgi.classes}"/>
@@ -762,8 +768,8 @@ TODO:
762768
<touch file="${build-libs.dir}/@{project}.complete" verbose="no"/>
763769
</then></if>
764770
</sequential>
765-
</macrodef>
766-
771+
</macrodef>
772+
767773
<target name="asm.done" depends="init"> <simple-javac project="asm" jar="no"/> </target>
768774
<target name="forkjoin.done" depends="init"> <simple-javac project="forkjoin" args="-XDignore.symbol.file"/></target>
769775

@@ -1418,80 +1424,39 @@ TODO:
14181424
<stopwatch name="quick.sbt-interface.timer" action="total"/>
14191425
</target>
14201426

1421-
<property name="partest.srcdir" value="files" /> <!-- TODO: make targets for `pending` and other subdirs -->
1427+
<!-- See test/build-partest.xml for the macro(s) being used here. -->
14221428

1423-
<target name="test.run" depends="pack.done">
1424-
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
1425-
timeout="1200000"
1426-
srcdir="${partest.srcdir}"
1427-
scalacopts="${scalac.args.optimise}">
1428-
1429-
<compilationpath refid="partest.build.path"/>
1430-
<runtests dir="${partest.dir}/${partest.srcdir}/run" includes="*.scala"/>
1431-
<jvmtests dir="${partest.dir}/${partest.srcdir}/jvm" includes="*.scala"/>
1432-
</partest>
1429+
<target name="test.suite" depends="pack.done">
1430+
<testSuite/>
14331431
</target>
14341432

1435-
<target name="test.suite" depends="pack.done">
1436-
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
1437-
timeout="2400000"
1438-
srcdir="${partest.srcdir}"
1439-
scalacopts="${scalac.args.optimise}">
1440-
<compilationpath refid="partest.build.path"/>
1441-
<postests dir="${partest.dir}/${partest.srcdir}/pos" includes="*.scala"/>
1442-
<negtests dir="${partest.dir}/${partest.srcdir}/neg" includes="*.scala"/>
1443-
<runtests dir="${partest.dir}/${partest.srcdir}/run" includes="*.scala"/>
1444-
<jvmtests dir="${partest.dir}/${partest.srcdir}/jvm" includes="*.scala"/>
1445-
<residenttests dir="${partest.dir}/${partest.srcdir}/res" includes="*.res"/>
1446-
<scalaptests dir="${partest.dir}/${partest.srcdir}/scalap" includes="**/*.scala"/>
1447-
<scalachecktests dir="${partest.dir}/${partest.srcdir}/scalacheck">
1448-
<include name="*.scala"/>
1449-
</scalachecktests>
1450-
<specializedtests dir="${partest.dir}/${partest.srcdir}/specialized">
1451-
<include name="*.scala"/>
1452-
</specializedtests>
1453-
<instrumentedtests dir="${partest.dir}/${partest.srcdir}/instrumented">
1454-
<include name="*.scala"/>
1455-
</instrumentedtests>
1456-
</partest>
1433+
<target name="test.suite.color" depends="pack.done">
1434+
<testSuite colors="8"/>
1435+
</target>
1436+
1437+
<target name="test.run" depends="pack.done">
1438+
<testSuite kinds="run jvm"/>
14571439
</target>
14581440

14591441
<target name="test.continuations.suite" depends="pack.done">
1460-
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
1461-
timeout="2400000"
1462-
srcdir="${partest.srcdir}"
1463-
scalacopts="${scalac.args.optimise} -Xplugin-require:continuations -P:continuations:enable">
1464-
<compilerarg value="-Xpluginsdir"/>
1465-
<compilerarg file="${build-quick.dir}/misc/scala-devel/plugins"/>
1466-
<compilationpath refid="partest.build.path"/>
1467-
<negtests dir="${partest.dir}/${partest.srcdir}/continuations-neg" includes="*.scala"/>
1468-
<runtests dir="${partest.dir}/${partest.srcdir}/continuations-run" includes="*.scala"/>
1469-
</partest>
1442+
<testSuite kinds="continuations-neg continuations-run"
1443+
scalacOpts="${scalac.args.optimise} -Xpluginsdir ${build-quick.dir}/misc/scala-devel/plugins -Xplugin-require:continuations -P:continuations:enable"
1444+
/>
14701445
</target>
14711446

14721447
<target name="test.scaladoc" depends="pack.done">
1473-
<partest erroronfailed="yes" scalacopts="${scalac.args.optimise}" showlog="yes">
1474-
<compilationpath refid="partest.build.path"/>
1475-
<runtests dir="${partest.dir}/scaladoc/run" includes="*.scala" />
1476-
<scalachecktests dir="${partest.dir}/scaladoc/scalacheck" includes="*.scala" />
1477-
</partest>
1448+
<testSuite kinds="run scalacheck" srcdir="scaladoc"/>
14781449
</target>
14791450

14801451
<target name="test.interactive" depends="pack.done">
1481-
<partest erroronfailed="yes" scalacopts="${scalac.args.optimise}" showlog="yes">
1482-
<compilationpath refid="partest.build.path"/>
1483-
<presentationtests dir="${partest.dir}/${partest.srcdir}/presentation">
1484-
<include name="*/*.scala"/>
1485-
</presentationtests>
1486-
</partest>
1452+
<testSuite kinds="presentation"/>
14871453
</target>
14881454

14891455
<!-- for use in PR validation, where stability is rarely broken, so we're going to use starr for locker,
14901456
and skip test.stability (which requires locker == quick) -->
14911457
<target name="test.core" depends="test.osgi, test.sbt, test.bc, test.interactive, test.continuations.suite, test.scaladoc, test.suite"/>
14921458
<target name="test.done" depends="test.core, test.stability"/>
14931459

1494-
14951460
<!-- ===========================================================================
14961461
BINARY COMPATIBILITY TESTING
14971462
============================================================================ -->

src/partest/scala/tools/partest/DirectTest.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package scala.tools.partest
77

88
import scala.tools.nsc._
9-
import io.Directory
109
import util.{BatchSourceFile, CommandLineParser}
1110
import reporters.{Reporter, ConsoleReporter}
1211

@@ -21,8 +20,8 @@ abstract class DirectTest extends App {
2120
def show(): Unit
2221

2322
// the test file or dir, and output directory
24-
def testPath = io.File(sys.props("partest.test-path"))
25-
def testOutput = io.Directory(sys.props("partest.output"))
23+
def testPath = SFile(sys.props("partest.test-path"))
24+
def testOutput = Directory(sys.props("partest.output"))
2625

2726
// override to add additional settings with strings
2827
def extraSettings: String = ""

src/partest/scala/tools/partest/IcodeTest.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
package scala.tools.partest
77

8-
import scala.tools.nsc._
9-
import nest.FileUtil._
10-
import io.Directory
8+
import scala.tools.partest.nest.FileUtil.compareContents
119

1210
/** A trait for testing icode. All you need is this in a
1311
* partest source file:

src/partest/scala/tools/partest/PartestDefaults.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package scala.tools
22
package partest
33

4-
import nsc.io.{ File, Path, Directory }
5-
import scala.tools.util.PathResolver
6-
import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty }
7-
import java.lang.Runtime.getRuntime
4+
import scala.tools.nsc.Properties.{ propOrElse, propOrNone, propOrEmpty }
5+
import java.lang.Runtime.{ getRuntime => runtime }
86

97
object PartestDefaults {
10-
import nsc.Properties._
118

129
def testRootName = propOrNone("partest.root")
1310
def srcDirName = propOrElse("partest.srcdir", "files")
@@ -23,7 +20,7 @@ object PartestDefaults {
2320

2421
def testBuild = propOrNone("partest.build")
2522
def errorCount = propOrElse("partest.errors", "0").toInt
26-
def numThreads = propOrNone("partest.threads") map (_.toInt) getOrElse getRuntime.availableProcessors
23+
def numThreads = propOrNone("partest.threads") map (_.toInt) getOrElse runtime.availableProcessors
2724

2825
def timeout = "1200000"
2926
}

0 commit comments

Comments
 (0)