[Native][tests] Minor. Rename effectivePackageName to nominalPackageName

This commit is contained in:
Dmitriy Dolovov
2021-11-18 23:12:22 +03:00
parent 3fa5363434
commit 7ea66076eb
2 changed files with 8 additions and 8 deletions
@@ -146,7 +146,7 @@ private class ExtTestDataFile(
testDataFile = testDataFile, testDataFile = testDataFile,
generatedSourcesBaseDir = environment.testSourcesDir generatedSourcesBaseDir = environment.testSourcesDir
), ),
effectivePackageName = computePackageName( nominalPackageName = computePackageName(
testDataBaseDir = environment.testRoots.baseDir, testDataBaseDir = environment.testRoots.baseDir,
testDataFile = testDataFile testDataFile = testDataFile
) )
@@ -262,7 +262,7 @@ private class ExtTestDataFile(
private fun patchPackageNames(isStandaloneTest: Boolean) = with(structure) { private fun patchPackageNames(isStandaloneTest: Boolean) = with(structure) {
if (isStandaloneTest) return // Don't patch packages for standalone tests. if (isStandaloneTest) return // Don't patch packages for standalone tests.
val basePackageName = FqName(settings.effectivePackageName) val basePackageName = FqName(settings.nominalPackageName)
val oldPackageNames: Set<FqName> = filesToTransform.mapToSet { it.packageFqName } val oldPackageNames: Set<FqName> = filesToTransform.mapToSet { it.packageFqName }
val oldToNewPackageNameMapping: Map<FqName, FqName> = oldPackageNames.associateWith { oldPackageName -> val oldToNewPackageNameMapping: Map<FqName, FqName> = oldPackageNames.associateWith { oldPackageName ->
@@ -538,7 +538,7 @@ private class ExtTestDataFile(
} }
if (!isStandaloneTest) { if (!isStandaloneTest) {
append("package ").appendLine(settings.effectivePackageName) append("package ").appendLine(settings.nominalPackageName)
appendLine() appendLine()
} }
@@ -575,7 +575,7 @@ private class ExtTestDataFile(
modules = modules, modules = modules,
freeCompilerArgs = assembleFreeCompilerArgs(), freeCompilerArgs = assembleFreeCompilerArgs(),
origin = TestOrigin.SingleTestDataFile(testDataFile), origin = TestOrigin.SingleTestDataFile(testDataFile),
nominalPackageName = settings.effectivePackageName, nominalPackageName = settings.nominalPackageName,
expectedOutputDataFile = null, expectedOutputDataFile = null,
extras = null extras = null
) )
@@ -633,7 +633,7 @@ private class ExtTestDataFileSettings(
val optInsForCompiler: Set<String>, val optInsForCompiler: Set<String>,
val expectActualLinker: Boolean, val expectActualLinker: Boolean,
val generatedSourcesDir: File, val generatedSourcesDir: File,
val effectivePackageName: PackageFQN val nominalPackageName: PackageFQN
) )
private typealias SharedModuleGenerator = (sharedModulesDir: File) -> TestModule.Shared? private typealias SharedModuleGenerator = (sharedModulesDir: File) -> TestModule.Shared?
@@ -45,7 +45,7 @@ internal class StandardTestCaseGroupProvider(private val environment: TestEnviro
generatedSourcesBaseDir = environment.testSourcesDir generatedSourcesBaseDir = environment.testSourcesDir
) )
val effectivePackageName = computePackageName( val nominalPackageName = computePackageName(
testDataBaseDir = environment.testRoots.baseDir, testDataBaseDir = environment.testRoots.baseDir,
testDataFile = testDataFile testDataFile = testDataFile
) )
@@ -178,7 +178,7 @@ internal class StandardTestCaseGroupProvider(private val environment: TestEnviro
if (testKind == TestKind.REGULAR) { if (testKind == TestKind.REGULAR) {
// Fix package declarations to avoid unintended conflicts between symbols with the same name in different test cases. // Fix package declarations to avoid unintended conflicts between symbols with the same name in different test cases.
testModules.values.forEach { testModule -> testModules.values.forEach { testModule ->
testModule.files.forEach { testFile -> fixPackageDeclaration(testFile, effectivePackageName, testDataFile) } testModule.files.forEach { testFile -> fixPackageDeclaration(testFile, nominalPackageName, testDataFile) }
} }
} }
@@ -187,7 +187,7 @@ internal class StandardTestCaseGroupProvider(private val environment: TestEnviro
modules = testModules.values.toSet(), modules = testModules.values.toSet(),
freeCompilerArgs = freeCompilerArgs, freeCompilerArgs = freeCompilerArgs,
origin = TestOrigin.SingleTestDataFile(testDataFile), origin = TestOrigin.SingleTestDataFile(testDataFile),
nominalPackageName = effectivePackageName, nominalPackageName = nominalPackageName,
expectedOutputDataFile = expectedOutputDataFile, expectedOutputDataFile = expectedOutputDataFile,
extras = if (testKind == TestKind.STANDALONE_NO_TR) { extras = if (testKind == TestKind.STANDALONE_NO_TR) {
TestCase.StandaloneNoTestRunnerExtras( TestCase.StandaloneNoTestRunnerExtras(