diff options
author | DarkDimius <darkdimius@gmail.com> | 2014-02-16 04:26:35 +0100 |
---|---|---|
committer | DarkDimius <darkdimius@gmail.com> | 2014-02-16 04:26:35 +0100 |
commit | 8755d8521e25e300edd8486958e6673e8b708f0e (patch) | |
tree | 29491474cd0142e1a59522bb7b69a5c17a47932a | |
parent | 153146c6774a5a06b1fbe7dc0ceb21b0e0a5e657 (diff) | |
parent | 1384048d0c01b5071ccc68e57fe49e802ed7c61b (diff) | |
download | dotty-8755d8521e25e300edd8486958e6673e8b708f0e.tar.gz dotty-8755d8521e25e300edd8486958e6673e8b708f0e.tar.bz2 dotty-8755d8521e25e300edd8486958e6673e8b708f0e.zip |
Merge pull request #23 from VladUreche/topic/scala-compile
Add Scalac scanning to the Travis CI build
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | project/Build.scala | 11 | ||||
-rw-r--r-- | test/test/ShowClassTests.scala | 21 |
3 files changed, 28 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml index 25d453828..0e31b0dbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: scala script: - - sbt update compile test + - sbt -Ddotty.travis.build=yes update compile test jdk: - oraclejdk7 notifications: @@ -9,3 +9,7 @@ notifications: branches: only: - master +before_install: + - cd .. + - git clone https://github.com/scala/scala.git + - cd dotty diff --git a/project/Build.scala b/project/Build.scala index a82fc3484..e268a54ee 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -4,6 +4,8 @@ import Process._ object DottyBuild extends Build { + val TRAVIS_BUILD = "dotty.travis.build" + val defaults = Defaults.defaultSettings ++ Seq( // set sources to src/, tests to test/ and resources to resources/ scalaSource in Compile := baseDirectory.value / "src", @@ -45,7 +47,14 @@ object DottyBuild extends Build { // dotty itself needs to be in the bootclasspath val fullpath = ("-Xbootclasspath/a:" + bin) :: path.toList // System.err.println("BOOTPATH: " + fullpath) - fullpath + + val travis_build = // propagate if this is a travis build + if (sys.props.isDefinedAt(TRAVIS_BUILD)) + List(s"-D$TRAVIS_BUILD=${sys.props(TRAVIS_BUILD)}") + else + List() + + travis_build ::: fullpath } ) diff --git a/test/test/ShowClassTests.scala b/test/test/ShowClassTests.scala index 1ed97a3df..f683b26e7 100644 --- a/test/test/ShowClassTests.scala +++ b/test/test/ShowClassTests.scala @@ -12,6 +12,11 @@ import org.junit.Test class ShowClassTests extends DottyTest { + def debug_println(msg: => Any) = { + if (!sys.props.isDefinedAt("dotty.travis.build")) + println(msg) + } + private val blackList = List( // the following classes cannot be read correctly because they // contain illegally pickled @throws annotations @@ -44,12 +49,12 @@ class ShowClassTests extends DottyTest { def showPackage(pkg: TermSymbol)(implicit ctx: Context): Unit = { val path = pkg.fullName.toString if (blackList contains path) - println(s"blacklisted package: $path") + debug_println(s"blacklisted package: $path") else { for ( sym <- pkg.info.decls if sym.owner == pkg.moduleClass && !(sym.name contains '$') ) { - println(s"showing $sym in ${pkg.fullName}") + debug_println(s"showing $sym in ${pkg.fullName}") if (sym is PackageVal) showPackage(sym.asTerm) else if (sym.isClass && !(sym is Module)) showClass(sym) else if (sym is ModuleVal) showClass(sym.moduleClass) @@ -60,25 +65,25 @@ class ShowClassTests extends DottyTest { def showPackage(path: String, expectedStubs: Int)(implicit ctx: Context): Unit = doTwice { implicit ctx => showPackage(ctx.requiredPackage(path)) val nstubs = Symbols.stubs.length - println(s"$nstubs stubs") + debug_println(s"$nstubs stubs") assert(nstubs <= expectedStubs, s"stubs found $nstubs, expected: $expectedStubs") } def showClass(cls: Symbol)(implicit ctx: Context) = { val path = cls.fullName.stripModuleClassSuffix.toString if (blackList contains path) - println(s"blacklisted: $path") + debug_println(s"blacklisted: $path") else { - println(s"showing $path -> ${cls.denot}") + debug_println(s"showing $path -> ${cls.denot}") val cinfo = cls.info val infoStr = if (cinfo.exists) cinfo.show else " is missing" - println("======================================") - println(cls.show + infoStr) + debug_println("======================================") + debug_println(cls.show + infoStr) } } def showClasses(path: String)(implicit ctx: Context): Unit = doTwice { implicit ctx => - println(s"showing file $path") + debug_println(s"showing file $path") val cls = ctx.requiredClass(path.toTypeName) showClass(cls) showClass(cls.linkedClass) |