Skip to content

Commit 1b4d36f

Browse files
authored
Merge pull request scala#5746 from paulp/pr/partest
Add partest paths to the list of watched sources.
2 parents 5f1a638 + eac00e1 commit 1b4d36f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,9 @@ commands += Command("partest")(_ => PartestUtil.partestParser((baseDirectory in
10181018
("test/it:testOnly -- " + parsed) :: state
10191019
}
10201020

1021+
// Watch the test files also so ~partest triggers on test case changes
1022+
watchSources ++= PartestUtil.testFilePaths((baseDirectory in ThisBuild).value, (baseDirectory in ThisBuild).value / "test")
1023+
10211024
// Add tab completion to scalac et al.
10221025
commands ++= {
10231026
val commands =

project/PartestUtil.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ object PartestUtil {
2626
isParentOf(testBase / srcPath, f, 2) || isParentOf(f, testBase / srcPath, Int.MaxValue)
2727
}
2828
}
29+
30+
def testFilePaths(globalBase: File, testBase: File): Seq[java.io.File] =
31+
(new TestFiles("files", globalBase, testBase)).allTestCases.map(_._1)
32+
2933
/** A parser for the custom `partest` command */
3034
def partestParser(globalBase: File, testBase: File): Parser[String] = {
3135
val knownUnaryOptions = List(

0 commit comments

Comments
 (0)