amanda.hinchman-dominguez
10/25/2019, 11:01 PMarrow-meta
, made sure that the gradle was synced to itself, set the JDK to 1.8, ran the ./gradlew
tasks in the CLI, and tried to run the tests from the IDE. Unfortunately, I'm getting this:jereksel
10/25/2019, 11:06 PMRun tests using
is set to Gradle (Default)
- in Settings -> Build, Execution, Deployment -> Build Tools -> Gradleamanda.hinchman-dominguez
10/25/2019, 11:11 PMjereksel
10/25/2019, 11:53 PMamanda.hinchman-dominguez
10/25/2019, 11:57 PMjereksel
10/26/2019, 12:01 AMamanda.hinchman-dominguez
10/26/2019, 12:03 AMRachel
10/27/2019, 5:20 PMFAILURE: Build failed with an exception
so I downloaded your branch and I tried to run the tests.e: (...) /EqOperatorTest.kt: (3, 12): Unresolved reference: tschuchort
e: (...) /EqOperatorTest.kt: (4, 12): Unresolved reference: tschuchort
e: (...) /EqOperatorTest.kt: (48, 5): Unresolved reference: KotlinCompilation
e: (...) /EqOperatorTest.kt: (49, 7): Unresolved reference: sources
e: (...) /EqOperatorTest.kt: (49, 24): Unresolved reference: SourceFile
e: (...) /EqOperatorTest.kt: (50, 7): Unresolved reference: classpaths
e: (...) /EqOperatorTest.kt: (51, 7): Unresolved reference: pluginClasspaths
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
EqOperatorTest
is including these dependencies which are being used in testing-plugin
.testing-plugin/build.gradle
is ready to include them with implementation "com.github.arrow-kt:kotlin-compile-testing:$kotlin_compile_testing"
.compileSourceCode
and classpathOf
were included temporarily in EqOperatorTest
to run just a compilation without any other assertions.EqOperatorTest
, it would be necessary to include:
testImplementation "com.github.arrow-kt:kotlin-compile-testing:1.2.3-SNAPSHOT"
compiler-plugin/build.gradle
.classpaths = listOf(classpathOf("arrow-meta-prototype:rr-meta-prototype-integration-SNAPSHOT"))
extension
annotation.arrow-annotations
so that line would be:
classpaths = listOf(classpathOf("arrow-annotations:rr-meta-prototype-integration-SNAPSHOT"))
testing-plugin
isn't being used here, only compileSourceCode
and classpathOf
which are in the same test class, so there aren't checks to inspect the result of the compilation.EqOperatorTest
, it`s necessary to look at the log:
e: /tmp/Kotlin-Compilation3830289531150025141/sources/Example.kt: (1, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation3830289531150025141/sources/Example.kt: (2, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation3830289531150025141/sources/Example.kt: (2, 4): Unresolved reference: extension
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (1, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (2, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (3, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (4, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (5, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (6, 1): Expecting an element
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (7, 1): Expecting an element
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (8, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (9, 1): Expecting a top level declaration
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (4, 4): Unresolved reference: extension
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (5, 16): Unresolved reference: Eq
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (5, 28): Unresolved reference: eq
e: /tmp/Kotlin-Compilation1071656820347319429/sources/Example.kt: (6, 8): Unresolved reference: eqv
Example.kt
files, you'll see the source code with |
.|
from code snippets (it's already done in testing-plugin
).compileSourceCode(EQ_FUNCTION.trimMargin())
...
compileSourceCode(EQ_EXTENSION.trimMargin())
extension
annotation at the beginning of each snippet:
| import arrow.extension
amanda.hinchman-dominguez
10/27/2019, 5:28 PMcom.github.arrow-kt:kotlin-compile-testing:1.2.3-SNAPSHOT
Rachel
10/27/2019, 5:49 PMclasspaths = listOf(classpathOf("arrow-annotations:rr-meta-prototype-integration-SNAPSHOT"))
classpaths = listOf(classpathOf("arrow-meta-prototype:rr-meta-prototype-integration-SNAPSHOT"))
compileSourceCode(EQ_FUNCTION.trimMargin())
...
compileSourceCode(EQ_EXTENSION.trimMargin())
amanda.hinchman-dominguez
10/27/2019, 8:16 PM|
from the comments for compiling source code?Rachel
10/27/2019, 9:46 PMmaster
branch, you'll get a new way to add the test you're looking for: just checking that it compilesval compilerPlugin = CompilerPlugin("Arrow Meta", listOf(Dependency("compiler-plugin")))
val arrowAnnotations = Dependency("arrow-annotations:rr-meta-prototype-integration-SNAPSHOT")
assertThis(CompilerTest(
config = {
addCompilerPlugins(compilerPlugin) + addDependencies(arrowAnnotations)
},
code = {
"""
|
| (code snippet)
|
""".source
},
assert = {
compiles
}
))
amanda.hinchman-dominguez
10/27/2019, 11:22 PM