Drop JvmMetadataVersion.skipCheck, support this correctly

Pass the value of this flag via DeserializationConfiguration
This commit is contained in:
Alexander Udalov
2017-02-08 18:31:02 +03:00
parent e1463f9e0f
commit a1a71a01b1
18 changed files with 73 additions and 70 deletions
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.load.kotlin.ModuleMapping
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
import java.io.File
@@ -38,7 +39,10 @@ class JvmPackageTableTest : KtUsefulTestCase() {
System.err.println(output) // normally output is empty
assertEquals("Compilation should complete successfully", ExitCode.OK, exitCode)
val mapping = ModuleMapping.create(File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test")
val mapping = ModuleMapping.create(
File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test",
DeserializationConfiguration.Default
)
val result = buildString {
for ((fqName, packageParts) in mapping.packageFqName2Parts) {
appendln(fqName)
@@ -417,14 +417,9 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
doTestPreReleaseKotlinLibrary("library");
}
/*
// This test should pass but is commented out because the compiler flag is implemented via mutation of the public field,
// which may cause subsequent tests to behave unexpectedly
// TODO: refactor and uncomment
public void testReleaseCompilerAgainstPreReleaseLibrarySkipVersionCheck() throws Exception {
doTestPreReleaseKotlinLibrary("library", "-Xskip-metadata-version-check");
}
*/
public void testWrongMetadataVersion() throws Exception {
doTestKotlinLibraryWithWrongMetadataVersion("library", null);
@@ -466,12 +461,9 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
);
}
/*
// TODO: refactor and uncomment
public void testWrongMetadataVersionSkipVersionCheck() throws Exception {
doTestKotlinLibraryWithWrongMetadataVersion("library", null, "-Xskip-metadata-version-check");
}
*/
/*test source mapping generation when source info is absent*/
public void testInlineFunWithoutDebugInfo() throws Exception {