You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- add basic support for `//> using target.platform jvm|scala-js` in Vulpix.
- if the directive is present, filter out files in compilation that dont match
the test platform, also add a suffix to the expected check-file name.
- duplicate UnrollTestPlatformSpecific files for jvm and scala-js platforms,
deleting the reflection code in scala-js version.
- remove directives from compilation tests not listened to by vulpix.
Copy file name to clipboardExpand all lines: compiler/test/dotty/tools/utils.scala
+37-4
Original file line number
Diff line number
Diff line change
@@ -57,25 +57,54 @@ def assertThrows[T <: Throwable: ClassTag](p: T => Boolean)(body: => Any): Unit
57
57
caseNonFatal(other) =>throwAssertionError(s"Wrong exception: expected ${implicitly[ClassTag[T]]} but was ${other.getClass.getName}").tap(_.addSuppressed(other))
58
58
endassertThrows
59
59
60
+
enumTestPlatform:
61
+
caseJVM, ScalaJS
62
+
overridedeftoString:String=thismatch
63
+
caseJVM=>"jvm"
64
+
caseScalaJS=>"scala-js"
65
+
66
+
objectTestPlatform:
67
+
defnamed(s: String):TestPlatform= s match
68
+
case"jvm"=>TestPlatform.JVM
69
+
case"scala-js"=>TestPlatform.ScalaJS
70
+
case _ =>throwIllegalArgumentException(s)
71
+
60
72
/** Famous tool names in the ecosystem. Used for tool args in test files. */
case directiveOptionsArg(args) =>List(("scalac", args))
111
142
case directiveJavacOptions(args) =>List(("javac", args))
143
+
case directiveTargetOptions(platform) =>List(("target", platform))
144
+
case directiveUnknown(rest) => sys.error(s"Unknown directive: `//> using ${CommandLineParser.tokenize(rest).headOption.getOrElse("''")}`${filename.fold("")(f =>s" in file $f")}")
0 commit comments