aboutsummaryrefslogtreecommitdiff
path: root/coroutine-utils-testing
diff options
context:
space:
mode:
Diffstat (limited to 'coroutine-utils-testing')
-rw-r--r--coroutine-utils-testing/build.gradle.kts11
-rw-r--r--coroutine-utils-testing/lint-baseline.xml4
-rw-r--r--coroutine-utils-testing/src/main/kotlin/app/passwordstore/test/CoroutineTestRule.kt48
3 files changed, 0 insertions, 63 deletions
diff --git a/coroutine-utils-testing/build.gradle.kts b/coroutine-utils-testing/build.gradle.kts
deleted file mode 100644
index 6b1c3d81..00000000
--- a/coroutine-utils-testing/build.gradle.kts
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
- * SPDX-License-Identifier: GPL-3.0-only
- */
-plugins { id("com.github.android-password-store.kotlin-jvm-library") }
-
-dependencies {
- implementation(projects.coroutineUtils)
- implementation(libs.testing.junit)
- implementation(libs.kotlin.coroutines.test)
-}
diff --git a/coroutine-utils-testing/lint-baseline.xml b/coroutine-utils-testing/lint-baseline.xml
deleted file mode 100644
index 752ac952..00000000
--- a/coroutine-utils-testing/lint-baseline.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.0.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.0.0)" variant="all" version="8.0.0">
-
-</issues>
diff --git a/coroutine-utils-testing/src/main/kotlin/app/passwordstore/test/CoroutineTestRule.kt b/coroutine-utils-testing/src/main/kotlin/app/passwordstore/test/CoroutineTestRule.kt
deleted file mode 100644
index e5e01ba9..00000000
--- a/coroutine-utils-testing/src/main/kotlin/app/passwordstore/test/CoroutineTestRule.kt
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-package app.passwordstore.test
-
-import app.passwordstore.util.coroutines.DispatcherProvider
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.TestCoroutineScheduler
-import kotlinx.coroutines.test.TestDispatcher
-import kotlinx.coroutines.test.UnconfinedTestDispatcher
-import kotlinx.coroutines.test.resetMain
-import kotlinx.coroutines.test.setMain
-import org.junit.rules.TestWatcher
-import org.junit.runner.Description
-
-/**
- * JUnit [TestWatcher] to correctly handle setting and resetting a given [testDispatcher] for tests.
- */
-@ExperimentalCoroutinesApi
-public class CoroutineTestRule(
- public val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(TestCoroutineScheduler()),
-) : TestWatcher() {
-
- public val testDispatcherProvider: DispatcherProvider =
- object : DispatcherProvider {
- override fun default(): CoroutineDispatcher = testDispatcher
-
- override fun io(): CoroutineDispatcher = testDispatcher
-
- override fun main(): CoroutineDispatcher = testDispatcher
-
- override fun unconfined(): CoroutineDispatcher = testDispatcher
- }
-
- override fun starting(description: Description) {
- super.starting(description)
- Dispatchers.setMain(testDispatcher)
- }
-
- override fun finished(description: Description) {
- super.finished(description)
- Dispatchers.resetMain()
- }
-}