Remove the version of fail.kt that was "hacked" for JS IR BE tests
This commit is contained in:
@@ -436,9 +436,8 @@ abstract class BasicBoxTest(
|
|||||||
testPackage: String?,
|
testPackage: String?,
|
||||||
testFunction: String
|
testFunction: String
|
||||||
) {
|
) {
|
||||||
val filteredUnits = units.filter { it !is TranslationUnit.SourceFile || !it.file.virtualFilePath.endsWith("js/js.translator/testData/_commonFiles/fail_hacked.kt") }
|
|
||||||
val translator = K2JSTranslator(config)
|
val translator = K2JSTranslator(config)
|
||||||
val translationResult = translator.translateUnits(ExceptionThrowingReporter, filteredUnits, mainCallParameters)
|
val translationResult = translator.translateUnits(ExceptionThrowingReporter, units, mainCallParameters)
|
||||||
|
|
||||||
if (translationResult !is TranslationResult.Success) {
|
if (translationResult !is TranslationResult.Success) {
|
||||||
val outputStream = ByteArrayOutputStream()
|
val outputStream = ByteArrayOutputStream()
|
||||||
@@ -477,7 +476,7 @@ abstract class BasicBoxTest(
|
|||||||
incrementalData.header = incrementalService.headerMetadata
|
incrementalData.header = incrementalService.headerMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
processJsProgram(translationResult.program, filteredUnits.filterIsInstance<TranslationUnit.SourceFile>().map { it.file })
|
processJsProgram(translationResult.program, units.filterIsInstance<TranslationUnit.SourceFile>().map { it.file })
|
||||||
checkSourceMap(outputFile, translationResult.program, remap)
|
checkSourceMap(outputFile, translationResult.program, remap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ abstract class BasicIrBoxTest(
|
|||||||
// TODO: temporary ignore some files from _commonFiles directory since they can't be compiled correctly by JS IR BE yet.
|
// TODO: temporary ignore some files from _commonFiles directory since they can't be compiled correctly by JS IR BE yet.
|
||||||
// Also, some declarations depends on stdlib but we don't have any library support in JS IR BE yet
|
// Also, some declarations depends on stdlib but we don't have any library support in JS IR BE yet
|
||||||
// and probably it will be better to avoid using stdlib in testData as much as possible.
|
// and probably it will be better to avoid using stdlib in testData as much as possible.
|
||||||
"js/js.translator/testData/_commonFiles/arrayAsserts.kt",
|
"js/js.translator/testData/_commonFiles/arrayAsserts.kt"
|
||||||
"js/js.translator/testData/_commonFiles/fail.kt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val filesToCompile = units
|
val filesToCompile = units
|
||||||
|
|||||||
+4
-1
@@ -2,4 +2,7 @@ package kotlin
|
|||||||
// This file should be excluded from tests using StdLib, as these methods conflict with corresponding methods from kotlin.test
|
// This file should be excluded from tests using StdLib, as these methods conflict with corresponding methods from kotlin.test
|
||||||
// see StdLibTestBase.removeAdHocAssertions
|
// see StdLibTestBase.removeAdHocAssertions
|
||||||
|
|
||||||
fun fail(message: String? = null) = js("throw new Error(message)")
|
fun fail(message: String? = null): Nothing {
|
||||||
|
js("throw new Error(message)")
|
||||||
|
null!!
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package kotlin
|
|
||||||
// This file should be excluded from tests using StdLib, as these methods conflict with corresponding methods from kotlin.test
|
|
||||||
// see StdLibTestBase.removeAdHocAssertions
|
|
||||||
|
|
||||||
fun fail(message: String? = null): Nothing {
|
|
||||||
null!!
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user