aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2014-02-16 02:45:52 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2014-02-16 03:47:40 +0100
commit1384048d0c01b5071ccc68e57fe49e802ed7c61b (patch)
tree29491474cd0142e1a59522bb7b69a5c17a47932a /test
parent153146c6774a5a06b1fbe7dc0ceb21b0e0a5e657 (diff)
downloaddotty-1384048d0c01b5071ccc68e57fe49e802ed7c61b.tar.gz
dotty-1384048d0c01b5071ccc68e57fe49e802ed7c61b.tar.bz2
dotty-1384048d0c01b5071ccc68e57fe49e802ed7c61b.zip
Add Scalac scanning to the Travis CI build
And silence some of the error messages we print so the build log doesn't go above 4MB (Travis' limit)
Diffstat (limited to 'test')
-rw-r--r--test/test/ShowClassTests.scala21
1 files changed, 13 insertions, 8 deletions
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)