JPS tests: support _dependencies.txt and _steps.txt for better files sorting
Original commit: 313c27859a
This commit is contained in:
+10
-3
@@ -281,8 +281,15 @@ abstract class AbstractIncrementalJpsTest(
|
|||||||
get() = File(testDataDir, "dependencies.txt")
|
get() = File(testDataDir, "dependencies.txt")
|
||||||
|
|
||||||
private fun readModulesTxt(): ModulesTxt? {
|
private fun readModulesTxt(): ModulesTxt? {
|
||||||
if (!modulesTxtFile.exists()) return null
|
var actualModulesTxtFile = modulesTxtFile
|
||||||
return ModulesTxtBuilder().readFile(modulesTxtFile)
|
|
||||||
|
if (!actualModulesTxtFile.exists()) {
|
||||||
|
// also try `"_${fileName}.txt"`. Useful for sorting files in IDE.
|
||||||
|
actualModulesTxtFile = modulesTxtFile.parentFile.resolve("_" + modulesTxtFile.name)
|
||||||
|
if (!actualModulesTxtFile.exists()) return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return ModulesTxtBuilder().readFile(actualModulesTxtFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun createBuildLog(incrementalMakeResults: List<AbstractIncrementalJpsTest.MakeResult>): String =
|
protected open fun createBuildLog(incrementalMakeResults: List<AbstractIncrementalJpsTest.MakeResult>): String =
|
||||||
@@ -416,7 +423,7 @@ abstract class AbstractIncrementalJpsTest(
|
|||||||
TouchPolicy.TIMESTAMP
|
TouchPolicy.TIMESTAMP
|
||||||
)
|
)
|
||||||
|
|
||||||
val stepsTxt = File(testDataSrc, "steps.txt")
|
val stepsTxt = File(testDataSrc, "_steps.txt")
|
||||||
val modificationNames = if (stepsTxt.exists()) stepsTxt.readLines() else null
|
val modificationNames = if (stepsTxt.exists()) stepsTxt.readLines() else null
|
||||||
|
|
||||||
modifications.forEachIndexed { index, step ->
|
modifications.forEachIndexed { index, step ->
|
||||||
|
|||||||
+1
-1
@@ -273,7 +273,7 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun generateStepsTxt() {
|
protected fun generateStepsTxt() {
|
||||||
File(dir, "steps.txt").setFileContent(steps.joinToString("\n"))
|
File(dir, "_steps.txt").setFileContent(steps.joinToString("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun generateBaseContent() {
|
fun generateBaseContent() {
|
||||||
|
|||||||
Reference in New Issue
Block a user