-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
182 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package hkmc2 | ||
|
||
import org.scalatest.{funsuite, ParallelTestExecution} | ||
import org.scalatest.time._ | ||
import org.scalatest.concurrent.{TimeLimitedTests, Signaler} | ||
import os.up | ||
|
||
import mlscript.utils._, shorthands._ | ||
|
||
|
||
class CompileTestRunner | ||
extends funsuite.AnyFunSuite | ||
with ParallelTestExecution | ||
// with TimeLimitedTests // TODO | ||
: | ||
|
||
private val inParallel = isInstanceOf[ParallelTestExecution] | ||
|
||
// val timeLimit = TimeLimit | ||
|
||
val pwd = os.pwd | ||
val workingDir = pwd | ||
|
||
val dir = workingDir/"hkmc2"/"shared"/"src"/"test" | ||
|
||
val validExt = Set("mls") | ||
|
||
val allFiles = os.walk(dir) | ||
.filter(_.toIO.isFile) | ||
.filter(_.ext in validExt) | ||
|
||
protected lazy val compileTestFiles = allFiles.filter: file => | ||
file.segments.contains("mlscript-compile") | ||
|
||
// TODO dedup path stuff with DiffTestRunner? | ||
compileTestFiles.foreach: file => | ||
|
||
val basePath = file.segments.drop(dir.segmentCount).toList.init | ||
val relativeName = basePath.map(_ + "/").mkString + file.baseName | ||
|
||
test(relativeName): | ||
|
||
println(s"Compiling: $relativeName") | ||
|
||
val preludePath = dir/"mlscript"/"decls"/"Prelude.mls" | ||
|
||
MLsCompiler(preludePath).compileModule(file) | ||
|
||
end CompileTestRunner | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.