JS test: use common dependencies.txt for MultipleModulesTranslationTest
This commit is contained in:
@@ -82,8 +82,8 @@ public abstract class MultipleModulesTranslationTest(main: String) : BasicTest(m
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun readModuleDependencies(testDataDir: String): Map<String, List<String>> {
|
private fun readModuleDependencies(testDataDir: String): Map<String, List<String>> {
|
||||||
val dependenciesTxt = File(testDataDir, "dependencies.txt")
|
val dependenciesTxt = upsearchFile(testDataDir, "dependencies.txt")
|
||||||
assert(dependenciesTxt.exists(), "moduleDependencies should not be null")
|
assert(dependenciesTxt.isFile(), "moduleDependencies should not be null")
|
||||||
|
|
||||||
val result = LinkedHashMap<String, List<String>>()
|
val result = LinkedHashMap<String, List<String>>()
|
||||||
for (line in dependenciesTxt.readLines()) {
|
for (line in dependenciesTxt.readLines()) {
|
||||||
@@ -97,4 +97,16 @@ public abstract class MultipleModulesTranslationTest(main: String) : BasicTest(m
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun upsearchFile(startingDir: String, name: String): File {
|
||||||
|
var dir: File? = File(startingDir)
|
||||||
|
var file = File(dir, name)
|
||||||
|
|
||||||
|
while (dir != null && dir.isDirectory() && !file.isFile()) {
|
||||||
|
dir = dir.parent
|
||||||
|
file = File(dir, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
return file
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user