From aa595fefcb8baa03d7b0f5ea167cc197f2ea3027 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 4 Dec 2022 20:34:33 +0100 Subject: [PATCH] combov2: Integrate comboctl unit tests Signed-off-by: Carlos Rafael Giani --- pump/combov2/build.gradle | 1 + pump/combov2/comboctl/build.gradle | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pump/combov2/build.gradle b/pump/combov2/build.gradle index eb54fc7c05..dce33a98dc 100644 --- a/pump/combov2/build.gradle +++ b/pump/combov2/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':core:utils') implementation project(':app-wear-shared:shared') implementation(project(":pump:combov2:comboctl")) + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version") implementation("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version") // This is necessary to avoid errors like these which otherwise come up often at runtime: // "WARNING: Failed to transform class kotlinx/datetime/TimeZone$Companion diff --git a/pump/combov2/comboctl/build.gradle b/pump/combov2/comboctl/build.gradle index c3e7bc7a41..ba5ea343da 100644 --- a/pump/combov2/comboctl/build.gradle +++ b/pump/combov2/comboctl/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply from: "${project.rootDir}/core/main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/main/test_dependencies.gradle" android { namespace 'info.nightscout.comboctl' @@ -10,6 +11,9 @@ android { kotlin.srcDirs += ['src/commonMain/kotlin', 'src/androidMain/kotlin'] manifest.srcFile 'src/androidMain/AndroidManifest.xml' } + test { + kotlin.srcDirs += ['src/jvmTest/kotlin'] + } } } @@ -18,4 +22,8 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version" implementation "androidx.core:core-ktx:$core_version" -} + testImplementation 'org.jetbrains.kotlin:kotlin-test' + testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version" +} \ No newline at end of file