Skip to content

Commit b0437d4

Browse files
committed
Added kotest native
1 parent b67ef3e commit b0437d4

31 files changed

+598
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ This repo contains multiple examples of how to use Kotest.
77
* [Multiplatform](./kotest-multiplatform) — example of a multiplatform project with JVM, JS and native
88
* [Javscript](./kotest-javascript) — example of a javascript project
99
* [Spring Webflux](./kotest-spring-webflux) — example of a JVM project using Spring Webflux
10-
* [Allure](./kotest-allure) — example of a JVM project using Allure test reporting
10+
* [Allure](./kotest-allure) — example of a JVM project using Allure test reporting
11+
* [Native](./kotest-native) — example of a Kotlin native project
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

kotest-native/.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
5+
indent_style = space
6+
indent_size = 3
7+
max_line_length = 120
8+
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

kotest-native/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
.allure
12+
13+
*.iml
14+
.idea
15+
16+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
17+
hs_err_pid*
18+
out/
19+
20+
build
21+
target
22+
.idea
23+
.gradle
24+
25+
allure-results/
26+
27+
# Gradle wrapper
28+
!gradle/wrapper/gradle-wrapper.jar
29+
30+
allure.log
31+
kotest.log
32+
kotest-tests-junit-report.log
33+
kotest-tests-core.log
34+
35+
local.properties
36+
.kotest
37+
/kotest-examples/kotest-examples-javascript/node_modules/
38+
*.gpg.enc
39+
40+
kotest-tests/kotest-tests-js/node_modules/
41+
.DS_Store

kotest-native/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# kotest-native
2+
3+
Example project showing how to use Kotest for native targets

kotest-native/build.gradle.kts

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
mavenLocal()
5+
}
6+
}
7+
8+
@Suppress("DSL_SCOPE_VIOLATION")
9+
plugins {
10+
alias(libs.plugins.kotlin.multiplatform)
11+
alias(libs.plugins.kotest.multiplatform)
12+
}
13+
14+
repositories {
15+
mavenCentral()
16+
mavenLocal()
17+
maven("https://oss.sonatype.org/content/repositories/snapshots")
18+
}
19+
20+
kotlin {
21+
22+
targets {
23+
linuxX64 {
24+
binaries {
25+
executable()
26+
}
27+
}
28+
29+
mingwX64()
30+
31+
macosX64()
32+
macosArm64()
33+
34+
tvos()
35+
tvosSimulatorArm64()
36+
37+
watchosArm32()
38+
watchosArm64()
39+
watchosX86()
40+
watchosX64()
41+
watchosSimulatorArm64()
42+
43+
iosX64()
44+
iosArm64()
45+
iosArm32()
46+
iosSimulatorArm64()
47+
}
48+
49+
sourceSets {
50+
51+
val commonMain by getting
52+
val commonTest by getting {
53+
dependencies {
54+
implementation(kotlin("test-common"))
55+
implementation(kotlin("test-annotations-common"))
56+
implementation(libs.kotlinx.coroutines.core)
57+
implementation(libs.kotest.framework.engine)
58+
}
59+
}
60+
61+
val desktopMain by creating {
62+
dependsOn(commonMain)
63+
dependencies {
64+
implementation(kotlin("native-utils"))
65+
}
66+
}
67+
68+
val linuxX64Main by getting {
69+
dependsOn(desktopMain)
70+
}
71+
72+
val desktopTest by creating {
73+
dependsOn(commonTest)
74+
}
75+
76+
val linuxX64Test by getting {
77+
dependsOn(desktopTest)
78+
}
79+
80+
val macosArm64Main by getting {
81+
dependsOn(desktopMain)
82+
}
83+
84+
val macosArm64Test by getting {
85+
dependsOn(desktopTest)
86+
}
87+
}
88+
}
89+
90+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
91+
kotlinOptions {
92+
apiVersion = "1.6"
93+
verbose = true
94+
}
95+
}

kotest-native/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kotlin.mpp.stability.nowarn=true
2+
org.gradle.jvmargs=-Xmx3G -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[versions]
2+
kotest = "5.4.2"
3+
kotlin = "1.6.21"
4+
coroutines = "1.6.4"
5+
6+
[libraries]
7+
kotest-framework-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
8+
9+
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
10+
11+
[plugins]
12+
kotest-multiplatform = { id = "io.kotest.multiplatform", version.ref = "kotest" }
13+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
58.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)