From 45e79846f9f98e21365ed73cbe316e58de5d8690 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Thu, 17 Sep 2020 20:31:46 +0300 Subject: [PATCH] Fix external tests: proper handle variables with getters and check vars in all files --- .../src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 569b2e9a2c8..c0dd2dc1958 100644 --- a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -265,6 +265,7 @@ class RunExternalTestGroup extends JavaExec { def packages = new LinkedHashSet() def imports = [] def classes = [] + def vars = new HashSet() // variables that has the same name as a package TestModule mainModule = null def testFiles = TestDirectivesKt.buildCompileList(project.file("build/$src").toPath(), "$outputDirectory/$src") @@ -335,11 +336,10 @@ class RunExternalTestGroup extends JavaExec { } // now replace all package usages in full qualified names def res = "" // filesToCompile - def vars = new HashSet() // variables that has the same name as a package text.eachLine { line -> packages.each { pkg -> // line contains val or var declaration or function parameter declaration - if ((line =~ ~/va(l|r) *$pkg *\=/) || (line =~ ~/fun .*\(\n?\s*$pkg:.*/)) { + if ((line =~ ~/va(l|r) *$pkg *(get\(\))? *\=/) || (line =~ ~/fun .*\(\n?\s*$pkg:.*/)) { vars.add(pkg) } if (line.contains("$pkg.") && !(line =~ packagePattern || line =~ importRegex)