2021-11-07 23:16:58 +00:00
|
|
|
package prog8tests
|
|
|
|
|
|
|
|
import io.kotest.core.config.AbstractProjectConfig
|
2024-05-29 00:26:04 +00:00
|
|
|
import io.kotest.core.spec.SpecExecutionOrder
|
|
|
|
import io.kotest.core.test.TestCaseOrder
|
2021-11-07 23:16:58 +00:00
|
|
|
|
|
|
|
object ProjectConfig : AbstractProjectConfig() {
|
2024-05-29 00:26:04 +00:00
|
|
|
override val testCaseOrder = TestCaseOrder.Lexicographic
|
|
|
|
override val specExecutionOrder = SpecExecutionOrder.Lexicographic
|
|
|
|
override val parallelism = kotlin.math.max(1, Runtime.getRuntime().availableProcessors()-1)
|
2021-11-07 23:16:58 +00:00
|
|
|
// override fun listeners() = listOf(SystemOutToNullListener)
|
|
|
|
}
|
|
|
|
|
|
|
|
//object SystemOutToNullListener: TestListener {
|
|
|
|
// override suspend fun beforeSpec(spec: Spec) = setup()
|
|
|
|
//
|
|
|
|
// private fun setup() {
|
|
|
|
// System.setOut(object: PrintStream(object: ByteArrayOutputStream(){
|
|
|
|
// override fun write(p0: Int) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// override fun write(b: ByteArray, off: Int, len: Int) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// override fun write(b: ByteArray) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
// }){}
|
|
|
|
// )
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//object SystemErrToNullListener: TestListener {
|
|
|
|
// override suspend fun beforeSpec(spec: Spec) = setup()
|
|
|
|
//
|
|
|
|
// private fun setup() {
|
|
|
|
// System.setErr(object: PrintStream(object: ByteArrayOutputStream(){
|
|
|
|
// override fun write(p0: Int) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// override fun write(b: ByteArray, off: Int, len: Int) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// override fun write(b: ByteArray) {
|
|
|
|
// // do nothing
|
|
|
|
// }
|
|
|
|
// }){}
|
|
|
|
// )
|
|
|
|
// }
|
|
|
|
//}
|