Skip to content

Commit 348b4f1

Browse files
committed
Remove kotest from multiplatform tests, kotest breaks wasm testing
1 parent 9e5c384 commit 348b4f1

7 files changed

Lines changed: 79 additions & 73 deletions

File tree

build-logic/orx-convention/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ tasks.withType<KotlinJvmCompile>().configureEach {
5050
}
5151

5252
kotlin {
53+
applyDefaultHierarchyTemplate()
5354
jvm {
5455
compilations {
5556
val main by getting
@@ -87,6 +88,11 @@ kotlin {
8788
nodejs()
8889
}
8990

91+
wasmJs() {
92+
browser()
93+
nodejs()
94+
}
95+
9096
sourceSets {
9197
val commonMain by getting {
9298
dependencies {

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ org.gradle.caching=true
1818
# https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library
1919
kotlin.stdlib.default.dependency=true
2020
kotlin.mpp.import.legacyTestSourceSetDetection=true
21+
kotlin.daemon.jvmargs=-Xmx2G
2122

2223
# Enable Dokka 2.0.0
2324
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

orx-color/src/commonTest/kotlin/ColorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/**
33
* orx-color
44
*/
5-
package org.openrndr.extra.color
5+
//package org.openrndr.extra.color
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
package org.openrndr.extra.color.colormaps
22

3-
import io.kotest.matchers.shouldBe
43
import org.openrndr.color.ColorRGBa
54
import org.openrndr.color.Linearity
65
import org.openrndr.math.Vector3
76
import kotlin.test.Test
7+
import kotlin.test.assertEquals
88

99
class TestSpectralZucconi6Colormap {
1010

1111
@Test
1212
fun testSpectralZucconi6Vector() {
13-
spectralZucconi6Vector(0.0) shouldBe Vector3(0.0, 0.0, 0.026075309353279508)
14-
spectralZucconi6Vector(0.5) shouldBe Vector3(0.49637374891706215, 0.8472371726323733, 0.18366091774095827)
15-
spectralZucconi6Vector(1.0) shouldBe Vector3(0.0, 0.0, 0.0)
16-
spectralZucconi6Vector(-0.1) shouldBe Vector3(0.0, 0.0, 0.0)
17-
spectralZucconi6Vector(1.1) shouldBe Vector3(0.0, 0.0, 0.0)
13+
assertEquals(spectralZucconi6Vector(0.0) , Vector3(0.0, 0.0, 0.026075309353279508))
14+
assertEquals(spectralZucconi6Vector(0.5) , Vector3(0.49637374891706215, 0.8472371726323733, 0.18366091774095827))
15+
assertEquals(spectralZucconi6Vector(1.0) , Vector3(0.0, 0.0, 0.0))
16+
assertEquals(spectralZucconi6Vector(-0.1) , Vector3(0.0, 0.0, 0.0))
17+
assertEquals(spectralZucconi6Vector(1.1) , Vector3(0.0, 0.0, 0.0))
1818
}
1919

2020
@Test
2121
fun testSpectralZucconi6() {
22-
spectralZucconi6(0.0) shouldBe ColorRGBa(0.0, 0.0, 0.026075309353279508, linearity = Linearity.LINEAR)
23-
spectralZucconi6(0.5) shouldBe ColorRGBa(0.49637374891706215, 0.8472371726323733, 0.18366091774095827, linearity = Linearity.LINEAR)
24-
spectralZucconi6(1.0) shouldBe ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR)
25-
spectralZucconi6(-0.1) shouldBe ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR)
26-
spectralZucconi6(1.1) shouldBe ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR)
22+
assertEquals(spectralZucconi6(0.0), ColorRGBa(0.0, 0.0, 0.026075309353279508, linearity = Linearity.LINEAR))
23+
assertEquals(spectralZucconi6(0.5), ColorRGBa(0.49637374891706215, 0.8472371726323733, 0.18366091774095827, linearity = Linearity.LINEAR))
24+
assertEquals(spectralZucconi6(1.0), ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR))
25+
assertEquals(spectralZucconi6(-0.1), ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR))
26+
assertEquals(spectralZucconi6(1.1), ColorRGBa(0.0, 0.0, 0.0, linearity = Linearity.LINEAR))
2727
}
2828

2929
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
package org.openrndr.extra.color.colormaps
22

3-
import io.kotest.matchers.shouldBe
43
import org.openrndr.color.ColorRGBa
54
import org.openrndr.color.Linearity
65
import org.openrndr.math.Vector3
76
import kotlin.test.Test
7+
import kotlin.test.assertEquals
88

99
class TestTurboColormap {
1010

1111
@Test
1212
fun testTurboColormapVector() {
13-
turboColormapVector(0.0) shouldBe Vector3(0.13572138, 0.09140261, 0.1066733)
14-
turboColormapVector(0.5) shouldBe Vector3(0.5885220621875007, 0.981864383125, 0.31316869781249856)
15-
turboColormapVector(1.0) shouldBe Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974)
16-
turboColormapVector(-0.1) shouldBe Vector3(0.13572138, 0.09140261, 0.1066733)
17-
turboColormapVector(1.1) shouldBe Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974)
13+
assertEquals(turboColormapVector(0.0), Vector3(0.13572138, 0.09140261, 0.1066733))
14+
assertEquals(turboColormapVector(0.5), Vector3(0.5885220621875007, 0.981864383125, 0.31316869781249856))
15+
assertEquals(turboColormapVector(1.0), Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974))
16+
assertEquals(turboColormapVector(-0.1), Vector3(0.13572138, 0.09140261, 0.1066733))
17+
assertEquals(turboColormapVector(1.1), Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974))
1818
}
1919

2020
@Test
2121
fun testTurboColormap() {
22-
turboColormap(0.0) shouldBe ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR)
23-
turboColormap(0.5) shouldBe ColorRGBa(0.5885220621875007, 0.981864383125, 0.31316869781249856, linearity = Linearity.LINEAR)
24-
turboColormap(1.0) shouldBe ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR)
25-
turboColormap(-0.1) shouldBe ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR)
26-
turboColormap(1.1) shouldBe ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR)
22+
assertEquals(turboColormap(0.0), ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR))
23+
assertEquals(turboColormap(0.5), ColorRGBa(0.5885220621875007, 0.981864383125, 0.31316869781249856, linearity = Linearity.LINEAR))
24+
assertEquals(turboColormap(1.0), ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR))
25+
assertEquals(turboColormap(-0.1), ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR))
26+
assertEquals(turboColormap(1.1), ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR))
2727
}
2828

2929
}
Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
import io.kotest.core.spec.style.DescribeSpec
2-
import org.openrndr.color.ColorRGBa
3-
import org.openrndr.color.Linearity
4-
import org.openrndr.extra.color.palettes.rangeTo
5-
6-
import kotlin.test.assertEquals
7-
import kotlin.test.assertSame
8-
9-
class TestMix : DescribeSpec({
10-
11-
describe("two srgb colors") {
12-
val a = ColorRGBa.BLUE
13-
val b = ColorRGBa.RED
14-
15-
assertEquals(Linearity.SRGB, a.linearity)
16-
17-
18-
it("should mix properly") {
19-
assertSame(a, a.mix(b, 0.0))
20-
assertSame(b, a.mix(b, 1.0))
21-
}
22-
}
23-
24-
describe("two linear rgb colors") {
25-
val a = ColorRGBa.BLUE.toLinear()
26-
val b = ColorRGBa.RED.toLinear()
27-
28-
it("should mix properly") {
29-
assertSame(a, a.mix(b, 0.0))
30-
assertSame(b, a.mix(b, 1.0))
31-
}
32-
}
33-
34-
describe("a 2-step range of colors") {
35-
val a = ColorRGBa.BLUE
36-
val b = ColorRGBa.RED
37-
38-
val blend = a..b blend 2
39-
assertEquals(2, blend.size)
40-
assertEquals(a, blend[0])
41-
assertEquals(b, blend[1])
42-
}
43-
44-
})
1+
//import org.openrndr.color.ColorRGBa
2+
//import org.openrndr.color.Linearity
3+
//import org.openrndr.extra.color.palettes.rangeTo
4+
//
5+
//import kotlin.test.assertEquals
6+
//import kotlin.test.assertSame
7+
//
8+
//class TestMix {
9+
//
10+
// describe("two srgb colors") {
11+
// val a = ColorRGBa.BLUE
12+
// val b = ColorRGBa.RED
13+
//
14+
// assertEquals(Linearity.SRGB, a.linearity)
15+
//
16+
//
17+
// it("should mix properly") {
18+
// assertSame(a, a.mix(b, 0.0))
19+
// assertSame(b, a.mix(b, 1.0))
20+
// }
21+
// }
22+
//
23+
// describe("two linear rgb colors") {
24+
// val a = ColorRGBa.BLUE.toLinear()
25+
// val b = ColorRGBa.RED.toLinear()
26+
//
27+
// it("should mix properly") {
28+
// assertSame(a, a.mix(b, 0.0))
29+
// assertSame(b, a.mix(b, 1.0))
30+
// }
31+
// }
32+
//
33+
// describe("a 2-step range of colors") {
34+
// val a = ColorRGBa.BLUE
35+
// val b = ColorRGBa.RED
36+
//
37+
// val blend = a..b blend 2
38+
// assertEquals(2, blend.size)
39+
// assertEquals(a, blend[0])
40+
// assertEquals(b, blend[1])
41+
// }
42+
//
43+
//})

orx-math/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ kotlin {
1515

1616
val commonTest by getting {
1717
dependencies {
18-
implementation(sharedLibs.kotlin.serialization.json)
19-
implementation(sharedLibs.kotest.assertions)
20-
implementation(sharedLibs.kotest.framework.engine)
18+
// implementation(sharedLibs.kotlin.serialization.json)
19+
// implementation(sharedLibs.kotest.assertions)
20+
// implementation(sharedLibs.kotest.framework.engine)
2121
}
2222
}
2323

2424
val jvmTest by getting {
2525
dependencies {
26-
implementation(sharedLibs.kotlin.serialization.json)
27-
implementation(sharedLibs.kotest.assertions)
28-
implementation(sharedLibs.kotest.framework.engine)
26+
// implementation(sharedLibs.kotlin.serialization.json)
27+
// implementation(sharedLibs.kotest.assertions)
28+
// implementation(sharedLibs.kotest.framework.engine)
2929
}
3030
}
3131

0 commit comments

Comments
 (0)