Workaround in FloatMathTest.powers to avoid failures with js-ir runtime

Include kotlin-stdlib-js-ir in local core libs build/test and
enable failing build on test failures.

Relates to: KT-24975
This commit is contained in:
Ilya Gorbunov
2019-10-15 06:22:37 +03:00
parent 65c09a5e57
commit bbdbc2896b
3 changed files with 12 additions and 7 deletions
+1 -3
View File
@@ -251,9 +251,7 @@ val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// Local builds are disabled at the request of the lib team
// TODO: Enable when tests are fixed
":kotlin-stdlib-js-ir".takeIf { isTeamcityBuild },
":kotlin-stdlib-js-ir",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
+1 -3
View File
@@ -193,9 +193,7 @@ task runMocha(type: NodeTask) {
args += [testOutputFile, kotlinTestTestOutputFile]
execOverrides {
// Tests are currently failing. Ignore the exit value for now
// TODO: replace with rootProject.ignoreTestFailures when tests are fixed
it.ignoreExitValue = true
it.ignoreExitValue = rootProject.ignoreTestFailures
it.workingDir = buildDir
}
}
+10 -1
View File
@@ -361,6 +361,15 @@ class FloatMathTest {
const val E = kotlin.math.E.toFloat()
}
// TODO: ensure it passes in kotlin-stdlib-js-ir after implementing KT-24975
@Ignore
@Test
fun floatRangeConversion() {
// expected run-time conversion to produce the same result as compile-time one
assertEquals(kotlin.math.E.toFloat(), E)
assertEquals(kotlin.math.PI.toFloat(), PI)
}
@Test fun trigonometric() {
assertEquals(0.0F, sin(0.0F))
assertAlmostEquals(0.0F, sin(PI))
@@ -480,7 +489,7 @@ class FloatMathTest {
assertTrue(sqrt(Float.NaN).isNaN())
assertTrue(exp(Float.NaN).isNaN())
assertAlmostEquals(E, exp(1.0F))
assertAlmostEquals(kotlin.math.E.toFloat(), exp(1.0F))
assertEquals(1.0F, exp(0.0F))
assertEquals(0.0F, exp(Float.NEGATIVE_INFINITY))
assertEquals(Float.POSITIVE_INFINITY, exp(Float.POSITIVE_INFINITY))