@@ -12,6 +12,11 @@ import org.junit.Test
12
12
13
13
class ShowClassTests extends DottyTest {
14
14
15
+ def debug_println (msg : => Any ) = {
16
+ if (! sys.props.isDefinedAt(" dotty.travis.build" ))
17
+ println(msg)
18
+ }
19
+
15
20
private val blackList = List (
16
21
// the following classes cannot be read correctly because they
17
22
// contain illegally pickled @throws annotations
@@ -44,12 +49,12 @@ class ShowClassTests extends DottyTest {
44
49
def showPackage (pkg : TermSymbol )(implicit ctx : Context ): Unit = {
45
50
val path = pkg.fullName.toString
46
51
if (blackList contains path)
47
- println (s " blacklisted package: $path" )
52
+ debug_println (s " blacklisted package: $path" )
48
53
else {
49
54
for (
50
55
sym <- pkg.info.decls if sym.owner == pkg.moduleClass && ! (sym.name contains '$' )
51
56
) {
52
- println (s " showing $sym in ${pkg.fullName}" )
57
+ debug_println (s " showing $sym in ${pkg.fullName}" )
53
58
if (sym is PackageVal ) showPackage(sym.asTerm)
54
59
else if (sym.isClass && ! (sym is Module )) showClass(sym)
55
60
else if (sym is ModuleVal ) showClass(sym.moduleClass)
@@ -60,25 +65,25 @@ class ShowClassTests extends DottyTest {
60
65
def showPackage (path : String , expectedStubs : Int )(implicit ctx : Context ): Unit = doTwice { implicit ctx =>
61
66
showPackage(ctx.requiredPackage(path))
62
67
val nstubs = Symbols .stubs.length
63
- println (s " $nstubs stubs " )
68
+ debug_println (s " $nstubs stubs " )
64
69
assert(nstubs <= expectedStubs, s " stubs found $nstubs, expected: $expectedStubs" )
65
70
}
66
71
67
72
def showClass (cls : Symbol )(implicit ctx : Context ) = {
68
73
val path = cls.fullName.stripModuleClassSuffix.toString
69
74
if (blackList contains path)
70
- println (s " blacklisted: $path" )
75
+ debug_println (s " blacklisted: $path" )
71
76
else {
72
- println (s " showing $path -> ${cls.denot}" )
77
+ debug_println (s " showing $path -> ${cls.denot}" )
73
78
val cinfo = cls.info
74
79
val infoStr = if (cinfo.exists) cinfo.show else " is missing"
75
- println (" ======================================" )
76
- println (cls.show + infoStr)
80
+ debug_println (" ======================================" )
81
+ debug_println (cls.show + infoStr)
77
82
}
78
83
}
79
84
80
85
def showClasses (path : String )(implicit ctx : Context ): Unit = doTwice { implicit ctx =>
81
- println (s " showing file $path" )
86
+ debug_println (s " showing file $path" )
82
87
val cls = ctx.requiredClass(path.toTypeName)
83
88
showClass(cls)
84
89
showClass(cls.linkedClass)
0 commit comments