@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunCheck
1818import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks
1919import org.jetbrains.kotlin.konan.test.blackbox.support.settings.*
2020import org.jetbrains.kotlin.konan.test.blackbox.support.util.createTestProvider
21+ import org.jetbrains.kotlin.native.executors.RunProcessException
2122import org.jetbrains.kotlin.native.executors.runProcess
2223import org.jetbrains.kotlin.test.KotlinTestUtils.assertEqualsToFile
2324import org.jetbrains.kotlin.test.KtAssert.fail
@@ -550,9 +551,12 @@ abstract class FrameworkTestBase : AbstractNativeSimpleTest() {
550551 val expectedLazyHeaderName = " expectedLazy/expectedLazy${suffix} .h"
551552 val expectedLazyHeader = objcExportTestSuiteDir.resolve(expectedLazyHeaderName)
552553 if (! expectedLazyHeader.exists() || expectedLazyHeader.readLines() != lazyHeader.readLines()) {
553- runProcess(" diff" , " -u" , expectedLazyHeader.absolutePath, lazyHeader.absolutePath)
554- lazyHeader.copyTo(expectedLazyHeader, overwrite = true )
555- fail(" $expectedLazyHeader file patched;\n Please review this change and commit the patch, if change is correct" )
554+ try {
555+ runProcess(" diff" , " -u" , expectedLazyHeader.absolutePath, lazyHeader.absolutePath)
556+ } catch (_: RunProcessException ) {
557+ lazyHeader.copyTo(expectedLazyHeader, overwrite = true )
558+ fail(" $expectedLazyHeader file patched;\n Please review this change and commit the patch, if change is correct" )
559+ }
556560 }
557561 }
558562 }
0 commit comments