aboutsummaryrefslogtreecommitdiff
path: root/test/test/CompilerTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/test/CompilerTest.scala')
-rw-r--r--test/test/CompilerTest.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala
index 23bdfd829..1dd65b6e0 100644
--- a/test/test/CompilerTest.scala
+++ b/test/test/CompilerTest.scala
@@ -6,7 +6,8 @@ import dotty.tools.dotc.reporting.Reporter
import scala.collection.mutable.ListBuffer
import scala.reflect.io.{ Path, Directory, File => SFile }
import scala.tools.partest.nest.FileManager
-import java.io.{ File => JFile }
+import java.io.{ RandomAccessFile, File => JFile }
+
import org.junit.Test
@@ -39,7 +40,14 @@ abstract class CompilerTest extends DottyTest {
def partestableDir(prefix: String, dirName: String, args: List[String], xerrors: Int) = true
def partestableList(testName: String, files: List[String], args: List[String], xerrors: Int) = true
- val generatePartestFiles = new JFile("tests", "runPartest.flag").exists
+ val generatePartestFiles = {
+ val partestLockFile = "." + JFile.separator + "tests" + JFile.separator + "partest.lock"
+ val partestLock = new RandomAccessFile(partestLockFile, "rw").getChannel.tryLock
+ if (partestLock != null) { // file not locked by sbt -> don't generate partest
+ partestLock.release
+ false
+ } else true
+ }
// Delete generated files from previous run
if (generatePartestFiles)