Allow custom expected result for fast class reading tests
This commit is contained in:
@@ -85,6 +85,11 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
checkJavaPackage(expectedFile, binaryPackageAndContext.first, binaryPackageAndContext.second, COMPARATOR_CONFIGURATION);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected File getExpectedFile(@NotNull String expectedFileName) {
|
||||
return new File(expectedFileName);
|
||||
}
|
||||
|
||||
protected void doTestCompiledJavaIncludeObjectMethods(@NotNull String javaFileName) throws Exception {
|
||||
doTestCompiledJava(javaFileName, RECURSIVE.renderDeclarationsFromOtherModules(true));
|
||||
}
|
||||
@@ -243,7 +248,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
srcFiles, compiledDir, ConfigurationKind.ALL
|
||||
);
|
||||
|
||||
checkJavaPackage(getTxtFile(javaFileName), javaPackageAndContext.first, javaPackageAndContext.second, configuration);
|
||||
checkJavaPackage(getExpectedFile(javaFileName.replaceFirst("\\.java$", ".txt")), javaPackageAndContext.first, javaPackageAndContext.second, configuration);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+9
@@ -16,6 +16,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.jvm.compiler
|
||||
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractLoadJavaWithFastClassReadingTest : AbstractLoadJavaTest() {
|
||||
override fun useFastClassFilesReading() = true
|
||||
|
||||
override fun getExpectedFile(expectedFileName: String): File {
|
||||
val differentResultFile = KotlinTestUtils.replaceExtension(File(expectedFileName), "fast.txt")
|
||||
if (differentResultFile.exists()) return differentResultFile
|
||||
return super.getExpectedFile(expectedFileName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user