diff --git a/.idea/modules.xml b/.idea/modules.xml
index 67404bd7ed16..d1fe0dd30b39 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -1076,6 +1076,7 @@
+
diff --git a/platform/platform-tests/intellij.platform.tests.iml b/platform/platform-tests/intellij.platform.tests.iml
index c2f309171025..cb653dc97bb3 100644
--- a/platform/platform-tests/intellij.platform.tests.iml
+++ b/platform/platform-tests/intellij.platform.tests.iml
@@ -90,5 +90,6 @@
+
\ No newline at end of file
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/CoroutineToIndicatorTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/progress/CoroutineToIndicatorTest.kt
index 974180b34971..72336de3df84 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/CoroutineToIndicatorTest.kt
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/CoroutineToIndicatorTest.kt
@@ -1,10 +1,11 @@
-// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.progress
import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.application.asContextElement
import com.intellij.openapi.application.impl.ModalityStateEx
import com.intellij.platform.util.progress.impl.ProgressState
+import com.intellij.platform.util.progress.progressReporterTest
import com.intellij.platform.util.progress.withRawProgressReporter
import com.intellij.testFramework.common.timeoutRunBlocking
import kotlinx.coroutines.CancellationException
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/RunBlockingCancellableTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/progress/RunBlockingCancellableTest.kt
index ce3bf82215a7..2870be159085 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/RunBlockingCancellableTest.kt
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/RunBlockingCancellableTest.kt
@@ -1,10 +1,11 @@
-// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.progress
import com.intellij.concurrency.currentThreadContextOrNull
import com.intellij.openapi.application.impl.ModalityStateEx
import com.intellij.platform.util.progress.impl.ProgressState
import com.intellij.platform.util.progress.progressReporter
+import com.intellij.platform.util.progress.progressReporterTest
import com.intellij.platform.util.progress.rawProgressReporter
import com.intellij.platform.util.progress.withRawProgressReporter
import com.intellij.testFramework.common.timeoutRunBlocking
diff --git a/platform/util/progress/intellij.platform.util.progress.tests.iml b/platform/util/progress/intellij.platform.util.progress.tests.iml
new file mode 100644
index 000000000000..12e8349c1d4f
--- /dev/null
+++ b/platform/util/progress/intellij.platform.util.progress.tests.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/ProgressReporterTest.kt b/platform/util/progress/tests/ProgressReporterTest.kt
similarity index 94%
rename from platform/platform-tests/testSrc/com/intellij/openapi/progress/ProgressReporterTest.kt
rename to platform/util/progress/tests/ProgressReporterTest.kt
index 050de22254b3..ce841f170b09 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/ProgressReporterTest.kt
+++ b/platform/util/progress/tests/ProgressReporterTest.kt
@@ -1,24 +1,11 @@
-// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
-package com.intellij.openapi.progress
+// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+package com.intellij.platform.util.progress
-import com.intellij.platform.util.progress.asContextElement
-import com.intellij.platform.util.progress.durationStep
import com.intellij.platform.util.progress.impl.ACCEPTABLE_FRACTION_OVERFLOW
import com.intellij.platform.util.progress.impl.ProgressState
-import com.intellij.platform.util.progress.impl.TextDetailsProgressReporter
-import com.intellij.platform.util.progress.indeterminateStep
-import com.intellij.platform.util.progress.itemDuration
-import com.intellij.platform.util.progress.progressReporter
-import com.intellij.platform.util.progress.progressStep
-import com.intellij.platform.util.progress.rawProgressReporter
-import com.intellij.platform.util.progress.withRawProgressReporter
-import com.intellij.testFramework.UsefulTestCase.assertOrderedEquals
-import com.intellij.testFramework.common.timeoutRunBlocking
-import com.intellij.util.containers.ContainerUtil
-import com.intellij.util.containers.init
-import com.intellij.util.containers.tail
import kotlinx.coroutines.*
-import org.junit.jupiter.api.Assertions.*
+import org.junit.jupiter.api.Assertions.assertTrue
+import org.junit.jupiter.api.Assertions.fail
import org.junit.jupiter.api.Test
class ProgressReporterTest {
@@ -803,23 +790,3 @@ class ProgressReporterTest {
}
}
}
-
-internal fun progressReporterTest(
- vararg expectedUpdates: ProgressState,
- action: suspend CoroutineScope.() -> Unit,
-) = timeoutRunBlocking {
- val actualUpdates = ContainerUtil.createConcurrentList()
- val progressReporter = TextDetailsProgressReporter(this)
- val collector = launch(Dispatchers.Unconfined + CoroutineName("state collector")) {
- progressReporter.progressState.collect { state ->
- actualUpdates.add(state)
- }
- }
- withContext(progressReporter.asContextElement(), action)
- progressReporter.close()
- progressReporter.awaitCompletion()
- collector.cancelAndJoin()
- assertEquals(ProgressState(null, null, -1.0), actualUpdates.first())
- assertEquals(ProgressState(null, null, 1.0), actualUpdates.last())
- assertOrderedEquals(actualUpdates.toList().init().tail(), expectedUpdates.toList())
-}
diff --git a/platform/util/progress/tests/test-util.kt b/platform/util/progress/tests/test-util.kt
new file mode 100644
index 000000000000..a310e35c74d3
--- /dev/null
+++ b/platform/util/progress/tests/test-util.kt
@@ -0,0 +1,41 @@
+// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+package com.intellij.platform.util.progress
+
+import com.intellij.platform.util.progress.impl.ProgressState
+import com.intellij.platform.util.progress.impl.TextDetailsProgressReporter
+import com.intellij.testFramework.TestLoggerFactory
+import com.intellij.testFramework.UsefulTestCase.assertOrderedEquals
+import com.intellij.testFramework.common.timeoutRunBlocking
+import com.intellij.util.containers.ContainerUtil
+import com.intellij.util.containers.init
+import com.intellij.util.containers.tail
+import kotlinx.coroutines.*
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.assertThrows
+
+fun progressReporterTest(
+ vararg expectedUpdates: ProgressState,
+ action: suspend CoroutineScope.() -> Unit,
+) = timeoutRunBlocking {
+ val actualUpdates = ContainerUtil.createConcurrentList()
+ val progressReporter = TextDetailsProgressReporter(this)
+ val collector = launch(Dispatchers.Unconfined + CoroutineName("state collector")) {
+ progressReporter.progressState.collect { state ->
+ actualUpdates.add(state)
+ }
+ }
+ withContext(progressReporter.asContextElement(), action)
+ progressReporter.close()
+ progressReporter.awaitCompletion()
+ collector.cancelAndJoin()
+ assertEquals(ProgressState(null, null, -1.0), actualUpdates.first())
+ assertEquals(ProgressState(null, null, 1.0), actualUpdates.last())
+ assertOrderedEquals(actualUpdates.toList().init().tail(), expectedUpdates.toList())
+}
+
+internal inline fun assertLogThrows(executable: () -> Unit): T {
+ return assertThrows {
+ val loggerError = assertThrows(executable)
+ throw requireNotNull(loggerError.cause)
+ }
+}