Removed ingoring files facility from incremental tests.
It is not necessary since script.xml are not generated in out directory anymore.
This commit is contained in:
@@ -111,7 +111,7 @@ public abstract class AbstractIncrementalJpsTest : JpsBuildTestCase() {
|
|||||||
|
|
||||||
rebuild()
|
rebuild()
|
||||||
|
|
||||||
assertEqualDirectories(outDir, outAfterMake, { it.name == "script.xml" })
|
assertEqualDirectories(outDir, outAfterMake)
|
||||||
|
|
||||||
FileUtil.delete(outAfterMake)
|
FileUtil.delete(outAfterMake)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import org.jetbrains.jet.lang.resolve.kotlin.VirtualFileKotlinClass
|
|||||||
|
|
||||||
fun File.hash() = Files.hash(this, Hashing.crc32())
|
fun File.hash() = Files.hash(this, Hashing.crc32())
|
||||||
|
|
||||||
fun getDirectoryString(dir: File, interestingPaths: List<String>, ignore: (File) -> Boolean): String {
|
fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
|
||||||
val buf = StringBuilder()
|
val buf = StringBuilder()
|
||||||
val p = Printer(buf)
|
val p = Printer(buf)
|
||||||
|
|
||||||
@@ -52,10 +52,6 @@ fun getDirectoryString(dir: File, interestingPaths: List<String>, ignore: (File)
|
|||||||
|
|
||||||
val children = listFiles!!.toList().sortBy { it.getName() }.sortBy { it.isDirectory() }
|
val children = listFiles!!.toList().sortBy { it.getName() }.sortBy { it.isDirectory() }
|
||||||
for (child in children) {
|
for (child in children) {
|
||||||
if (ignore(child)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (child.isDirectory()) {
|
if (child.isDirectory()) {
|
||||||
p.println(child.name)
|
p.println(child.name)
|
||||||
addDirContent(child)
|
addDirContent(child)
|
||||||
@@ -82,10 +78,10 @@ fun getDirectoryString(dir: File, interestingPaths: List<String>, ignore: (File)
|
|||||||
return buf.toString()
|
return buf.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAllRelativePaths(dir: File, ignore: (File) -> Boolean): Set<String> {
|
fun getAllRelativePaths(dir: File): Set<String> {
|
||||||
val result = HashSet<String>()
|
val result = HashSet<String>()
|
||||||
FileUtil.processFilesRecursively(dir) {
|
FileUtil.processFilesRecursively(dir) {
|
||||||
if (it!!.isFile() && !ignore(it)) {
|
if (it!!.isFile()) {
|
||||||
result.add(FileUtil.getRelativePath(dir, it)!!)
|
result.add(FileUtil.getRelativePath(dir, it)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,16 +91,16 @@ fun getAllRelativePaths(dir: File, ignore: (File) -> Boolean): Set<String> {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun assertEqualDirectories(expected: File, actual: File, ignore: (File) -> Boolean) {
|
fun assertEqualDirectories(expected: File, actual: File) {
|
||||||
val pathsInExpected = getAllRelativePaths(expected, ignore)
|
val pathsInExpected = getAllRelativePaths(expected)
|
||||||
val pathsInActual = getAllRelativePaths(actual, ignore)
|
val pathsInActual = getAllRelativePaths(actual)
|
||||||
|
|
||||||
val changedPaths = Sets.intersection(pathsInExpected, pathsInActual)
|
val changedPaths = Sets.intersection(pathsInExpected, pathsInActual)
|
||||||
.filter { !Arrays.equals(File(expected, it).readBytes(), File(actual, it).readBytes()) }
|
.filter { !Arrays.equals(File(expected, it).readBytes(), File(actual, it).readBytes()) }
|
||||||
.sort()
|
.sort()
|
||||||
|
|
||||||
val expectedString = getDirectoryString(expected, changedPaths, ignore)
|
val expectedString = getDirectoryString(expected, changedPaths)
|
||||||
val actualString = getDirectoryString(actual, changedPaths, ignore)
|
val actualString = getDirectoryString(actual, changedPaths)
|
||||||
|
|
||||||
assertEquals(expectedString, actualString)
|
assertEquals(expectedString, actualString)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user