1 /* 2 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5 package kotlinx.coroutines 6 7 import platform.CoreFoundation.* 8 import kotlin.native.concurrent.* 9 import kotlin.native.internal.test.* 10 import kotlin.system.* 11 12 // This is a separate entry point for tests in background mainBackgroundnull13fun mainBackground(args: Array<String>) { 14 val worker = Worker.start(name = "main-background") 15 worker.execute(TransferMode.SAFE, { args.freeze() }) { 16 val result = testLauncherEntryPoint(it) 17 exitProcess(result) 18 } 19 CFRunLoopRun() 20 error("CFRunLoopRun should never return") 21 } 22 23 // This is a separate entry point for tests with leak checker mainNoExitnull24fun mainNoExit(args: Array<String>) { 25 workerMain { // autoreleasepool to make sure interop objects are properly freed 26 testLauncherEntryPoint(args) 27 } 28 }