Skip to content

Commit

Permalink
[JS] Revert disabling running ES6 tests on all platforms except linux
Browse files Browse the repository at this point in the history
Revert "[JS TESTS] Emulate failing of non-run tests"

This reverts commit 2fd6921

Revert "[JS TESTS] Don't run ES6 test on win & mac till j2v8 issue is fixed."

This reverts commit 0862416

Revert "[JS TESTS] Add EP to disable run test on specific platform"

This reverts commit 5016226
  • Loading branch information
bashor committed Dec 7, 2020
1 parent 2cb4a49 commit 39cc149
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
13 changes: 1 addition & 12 deletions js/js.tests/test/org/jetbrains/kotlin/js/test/BasicBoxTest.kt
Expand Up @@ -104,8 +104,6 @@ abstract class BasicBoxTest(
doTest(filePath, "OK", MainCallParameters.noCall(), coroutinesPackage)
}

open fun dontRunOnSpecificPlatform(targetBackend: TargetBackend): Boolean = false

open fun doTest(filePath: String, expectedResult: String, mainCallParameters: MainCallParameters, coroutinesPackage: String = "") {
val file = File(filePath)
val outputDir = getOutputDir(file)
Expand Down Expand Up @@ -258,7 +256,7 @@ abstract class BasicBoxTest(
globalCommonFiles + localCommonFiles + additionalCommonFiles + additionalMainFiles


val dontRunGeneratedCode = InTextDirectivesUtils.dontRunGeneratedCode(targetBackend, file) || dontRunOnSpecificPlatform(targetBackend)
val dontRunGeneratedCode = InTextDirectivesUtils.dontRunGeneratedCode(targetBackend, file)

if (!dontRunGeneratedCode && generateNodeJsRunner && !SKIP_NODE_JS.matcher(fileContent).find()) {
val nodeRunnerName = mainModule.outputFileName(outputDir) + ".node.js"
Expand All @@ -279,15 +277,6 @@ abstract class BasicBoxTest(
if (runIrPir && !skipDceDriven) {
runGeneratedCode(pirAllJsFiles, testModuleName, testPackage, testFunction, expectedResult, withModuleSystem)
}
} else {
val ignored = InTextDirectivesUtils.isIgnoredTarget(
targetBackend, file,
InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX
)

if (ignored) {
throw AssertionError("Ignored test hasn't been ran. Emulate its failing")
}
}

performAdditionalChecks(generatedJsFiles.map { it.first }, outputPrefixFile, outputPostfixFile)
Expand Down
15 changes: 1 addition & 14 deletions js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

Expand Down Expand Up @@ -59,8 +59,6 @@ abstract class BasicIrBoxTest(

val perModule: Boolean = getBoolean("kotlin.js.ir.perModule")

private val osName: String = System.getProperty("os.name").toLowerCase()

// TODO Design incremental compilation for IR and add test support
override val incrementalCompilationChecksEnabled = false

Expand Down Expand Up @@ -209,17 +207,6 @@ abstract class BasicIrBoxTest(
cachedDependencies[outputFile.absolutePath] = dependencyPaths
}

override fun dontRunOnSpecificPlatform(targetBackend: TargetBackend): Boolean {
if (targetBackend != TargetBackend.JS_IR_ES6) return false
if (!runEs6Mode) return false

// TODO: Since j2v8 does not support ES6 on mac and windows, temporary don't run such test on those platforms.
if (osName.indexOf("win") >= 0) return true
if (osName.indexOf("mac") >= 0 || osName.indexOf("darwin") >= 0) return true

return false
}

override fun runGeneratedCode(
jsFiles: List<String>,
testModuleName: String?,
Expand Down

0 comments on commit 39cc149

Please sign in to comment.