summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2016-06-14 12:38:58 +0200
committerStefan Zeiger <szeiger@novocode.com>2016-06-14 15:54:01 +0200
commitf2d0f1e85d8b348cd2506a45502e4e59f9ec8e49 (patch)
tree340370a3c4cac8da3a43886d1edffd1bac636bdf /test
parent91b6944480a3b37f1d62a8a2ed3c332ce02a835a (diff)
downloadscala-f2d0f1e85d8b348cd2506a45502e4e59f9ec8e49.tar.gz
scala-f2d0f1e85d8b348cd2506a45502e4e59f9ec8e49.tar.bz2
scala-f2d0f1e85d8b348cd2506a45502e4e59f9ec8e49.zip
Use sbt for PR validation
- Support directories in `-doc-external-doc`: It is documented as accepting a “classpath_entry_path” for the keys but this only worked for JARs and not for individual class files. When checking for external-doc mappings for a Symbol, we now find the root directory relative to a class file instead of using the full class file path. The corresponding tests for SI-191 and SI8557 are also fixed to support individual class files instead of JARs in partest. This is required for the sbt build which runs partest on “quick” instead of “pack”. - Fix version and repository handling for bootstrapping. The bootstrap `scalaInstance` can now be resolved from any repository added to the project (not just the bootstrap repositories) by using a different workaround for https://github.com/sbt/sbt/issues/1872. - Workaround for https://github.com/sbt/sbt/issues/2640 (putting the wrong `scalaInstance` on partest’s classpath). The required `ScalaInstance` constructor is deprecated, so we have to disable deprecation warnings and fatal warnings until there is a better fix. - Add MiMa to the sbt build (port of the old `test.bc` ant task). The sbt-mima plugin doesn’t have all the features we need, so we do it manually in a similar way to what the plugin does. Checks are done in both directions for the `library` and `compiler` projects. The base version has to be set in `build.sbt`. When set to `None`, MiMa checks are skipped. MiMa checks are run sequentially to avoid spurious errors (see https://github.com/typesafehub/migration-manager/issues/115). - Port the OSGi tests to the sbt build. The set of JARs that gets copied into build/osgi as bundles is a bit different from the ant build. We omit the source JARs but add additional modules that are part of the Scala distribution, which seems more correct. - Get rid up `pull-binary-libs.sh` for the sbt build. Add artifacts are resolved from the special bootstrap repository through Ivy. The special `code.jar` and `instrumented.jar` artifacts are copied to the location where partest expects them (because these paths are hardcoded in partest). Other extra JARs for partest in `test/files/lib` are referenced directly from the Ivy cache. - Move common settings that should be available with unqualified names in local `.sbt` files and on the command line into an auto-plugin. - Add an `antStyle` setting to sbt to allow users to easily enable ant-style incremental compilation instead of sbt’s standard name hashing with `set antStyle := true`. - Disable verbose `info`-level logging during sbt startup for both, `validate/test` and `validate/publish-core` jobs. Update logging is no longer disabled when running locally (where it is useful and doesn’t generate excessive output). - Pass optimization flags for scalac down to partest, using the new partest version 1.0.15\6. - Call the new sbt-based PR validation from `scripts/jobs/validate/test`. - Disable the tests `run/t7843-jsr223-service` and `run/t7933` from https://github.com/scala/scala/pull/4959 for now. We need to set up a new test project (either partest or junit) that can run them on a packaged version of Scala, or possibly move them into a separate project that would naturally run from a packaged Scala as part of the community build.
Diffstat (limited to 'test')
-rw-r--r--test/disabled/run/t7843-jsr223-service.check (renamed from test/files/run/t7843-jsr223-service.check)0
-rw-r--r--test/disabled/run/t7843-jsr223-service.scala (renamed from test/files/run/t7843-jsr223-service.scala)0
-rw-r--r--test/disabled/run/t7933.check (renamed from test/files/run/t7933.check)0
-rw-r--r--test/disabled/run/t7933.scala (renamed from test/files/run/t7933.scala)0
-rw-r--r--test/osgi/src/logback.xml10
-rw-r--r--test/scaladoc/.gitignore2
-rw-r--r--test/scaladoc/run/SI-191.scala12
-rw-r--r--test/scaladoc/run/t8557.scala20
8 files changed, 37 insertions, 7 deletions
diff --git a/test/files/run/t7843-jsr223-service.check b/test/disabled/run/t7843-jsr223-service.check
index a668df3567..a668df3567 100644
--- a/test/files/run/t7843-jsr223-service.check
+++ b/test/disabled/run/t7843-jsr223-service.check
diff --git a/test/files/run/t7843-jsr223-service.scala b/test/disabled/run/t7843-jsr223-service.scala
index 3c853878ba..3c853878ba 100644
--- a/test/files/run/t7843-jsr223-service.scala
+++ b/test/disabled/run/t7843-jsr223-service.scala
diff --git a/test/files/run/t7933.check b/test/disabled/run/t7933.check
index 317e9677c3..317e9677c3 100644
--- a/test/files/run/t7933.check
+++ b/test/disabled/run/t7933.check
diff --git a/test/files/run/t7933.scala b/test/disabled/run/t7933.scala
index 58e39dd384..58e39dd384 100644
--- a/test/files/run/t7933.scala
+++ b/test/disabled/run/t7933.scala
diff --git a/test/osgi/src/logback.xml b/test/osgi/src/logback.xml
new file mode 100644
index 0000000000..692ccbfdd9
--- /dev/null
+++ b/test/osgi/src/logback.xml
@@ -0,0 +1,10 @@
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>*** \(%logger{30}\)%green(%X{debugId}) %msg%n</pattern>
+ </encoder>
+ </appender>
+ <root level="${log.root:-warn}">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>
diff --git a/test/scaladoc/.gitignore b/test/scaladoc/.gitignore
new file mode 100644
index 0000000000..161be5b55f
--- /dev/null
+++ b/test/scaladoc/.gitignore
@@ -0,0 +1,2 @@
+*.log
+*.obj/
diff --git a/test/scaladoc/run/SI-191.scala b/test/scaladoc/run/SI-191.scala
index 29b1e7dd29..f3d269ceb0 100644
--- a/test/scaladoc/run/SI-191.scala
+++ b/test/scaladoc/run/SI-191.scala
@@ -33,10 +33,14 @@ object Test extends ScaladocModelTest {
def scalaURL = "http://bog.us"
override def scaladocSettings = {
- val scalaLibUri = getClass.getClassLoader.getResource("scala/Function1.class").getPath.split("!")(0)
- val scalaLibPath = new URI(scalaLibUri).getPath
- val externalArg = s"$scalaLibPath#$scalaURL"
- "-no-link-warnings -doc-external-doc " + externalArg
+ val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath
+ val scalaLibPath = if(samplePath.contains("!")) { // in scala-library.jar
+ val scalaLibUri = samplePath.split("!")(0)
+ new URI(scalaLibUri).getPath
+ } else { // individual class files on disk
+ samplePath.replace('\\', '/').dropRight("scala/Function1.class".length)
+ }
+ s"-no-link-warnings -doc-external-doc $scalaLibPath#$scalaURL"
}
def testModel(rootPackage: Package) {
diff --git a/test/scaladoc/run/t8557.scala b/test/scaladoc/run/t8557.scala
index 451f004d7d..7876896bb7 100644
--- a/test/scaladoc/run/t8557.scala
+++ b/test/scaladoc/run/t8557.scala
@@ -1,3 +1,5 @@
+import java.net.URI
+
import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
@@ -15,10 +17,22 @@ object Test extends ScaladocModelTest {
class A
"""
+ def scalaURL = "http://www.scala-lang.org/api/current/"
+
// a non-canonical path to scala-library.jar should still work
- // this is a bit fragile (depends on the current directory being the root of the repo ;
- // ant & partest seem to do that properly)
- def scaladocSettings = "-doc-external-doc build/pack/bin/../lib/scala-library.jar#http://www.scala-lang.org/api/current/"
+ override def scaladocSettings = {
+ val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath.replace('\\', '/')
+ val scalaLibPath = if(samplePath.contains("!")) { // in scala-library.jar
+ val scalaLibUri = samplePath.split("!")(0)
+ val p = new URI(scalaLibUri).getPath
+ // this is a bit fragile (depends on the scala library being in build/pack as produced by ant)
+ p.replace("/pack/lib/scala-library.jar", "/pack/bin/../lib/scala-library.jar")
+ } else { // individual class files on disk
+ val p = samplePath.dropRight("scala/Function1.class".length + 1)
+ p + "/.." + p.takeRight(p.length - p.lastIndexOf('/'))
+ }
+ s"-doc-external-doc $scalaLibPath#$scalaURL"
+ }
def testModel(rootPackage: Package) = {
// get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))