Minor, refactor compiler-running code in multiplatform integration test
The compiler is run twice and outputs are compared for equality. Thus, if both runs ended with exceptions, the outputs were never equal because the compiler was run from different places (stack traces were different in only one line), which was a bit weird. Now outputs are equal and in case of an exception, a standard "actual data differs from file content" message is displayed
This commit is contained in:
+7
-2
@@ -70,8 +70,13 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
|
||||
}
|
||||
|
||||
private fun CLICompiler<*>.compileBothWays(commonSource: File, platformSource: File, vararg mainArguments: String): String {
|
||||
val platformFirst = compile(listOf(platformSource, commonSource), *mainArguments)
|
||||
val commonFirst = compile(listOf(commonSource, platformSource), *mainArguments)
|
||||
val configurations = listOf(
|
||||
listOf(platformSource, commonSource),
|
||||
listOf(commonSource, platformSource)
|
||||
)
|
||||
|
||||
val (platformFirst, commonFirst) = configurations.map { compile(it, *mainArguments) }
|
||||
|
||||
if (platformFirst != commonFirst) {
|
||||
assertEquals(
|
||||
"Compilation results are different when compiling [platform-specific, common] compared to when compiling [common, platform-specific]",
|
||||
|
||||
Reference in New Issue
Block a user