Remove the version of fail.kt that was "hacked" for JS IR BE tests

This commit is contained in:
Zalim Bashorov
2018-04-24 19:48:58 +03:00
parent 34587d9192
commit 27988cd2f4
4 changed files with 7 additions and 13 deletions
@@ -436,9 +436,8 @@ abstract class BasicBoxTest(
testPackage: 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 translationResult = translator.translateUnits(ExceptionThrowingReporter, filteredUnits, mainCallParameters)
val translationResult = translator.translateUnits(ExceptionThrowingReporter, units, mainCallParameters)
if (translationResult !is TranslationResult.Success) {
val outputStream = ByteArrayOutputStream()
@@ -477,7 +476,7 @@ abstract class BasicBoxTest(
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)
}
@@ -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.
// 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.
"js/js.translator/testData/_commonFiles/arrayAsserts.kt",
"js/js.translator/testData/_commonFiles/fail.kt"
"js/js.translator/testData/_commonFiles/arrayAsserts.kt"
)
val filesToCompile = units
+4 -1
View File
@@ -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
// 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!!
}
-7
View File
@@ -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!!
}