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 PMamanda.hinchman-dominguez
10/25/2019, 11:42 PMamanda.hinchman-dominguez
10/25/2019, 11:43 PMamanda.hinchman-dominguez
10/25/2019, 11:47 PMjereksel
10/25/2019, 11:53 PMjereksel
10/25/2019, 11:54 PMamanda.hinchman-dominguez
10/25/2019, 11:57 PMamanda.hinchman-dominguez
10/25/2019, 11:59 PMjereksel
10/26/2019, 12:01 AMamanda.hinchman-dominguez
10/26/2019, 12:03 AMamanda.hinchman-dominguez
10/26/2019, 12:04 AMRachel
10/27/2019, 5:20 PMFAILURE: Build failed with an exception
so I downloaded your branch and I tried to run the tests.Rachel
10/27/2019, 5:20 PMe: (...) /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
Rachel
10/27/2019, 5:20 PMimport com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
Rachel
10/27/2019, 5:20 PMEqOperatorTest
is including these dependencies which are being used in testing-plugin
.Rachel
10/27/2019, 5:21 PMtesting-plugin/build.gradle
is ready to include them with implementation "com.github.arrow-kt:kotlin-compile-testing:$kotlin_compile_testing"
.Rachel
10/27/2019, 5:21 PMcompileSourceCode
and classpathOf
were included temporarily in EqOperatorTest
to run just a compilation without any other assertions.Rachel
10/27/2019, 5:21 PMEqOperatorTest
, it would be necessary to include:
testImplementation "com.github.arrow-kt:kotlin-compile-testing:1.2.3-SNAPSHOT"
Rachel
10/27/2019, 5:21 PMcompiler-plugin/build.gradle
.Rachel
10/27/2019, 5:21 PMclasspaths = listOf(classpathOf("arrow-meta-prototype:rr-meta-prototype-integration-SNAPSHOT"))
Rachel
10/27/2019, 5:21 PMRachel
10/27/2019, 5:21 PMextension
annotation.Rachel
10/27/2019, 5:22 PMarrow-annotations
so that line would be:
classpaths = listOf(classpathOf("arrow-annotations:rr-meta-prototype-integration-SNAPSHOT"))
Rachel
10/27/2019, 5:22 PMRachel
10/27/2019, 5:23 PMRachel
10/27/2019, 5:23 PMtesting-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.Rachel
10/27/2019, 5:23 PMEqOperatorTest
, 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
Rachel
10/27/2019, 5:23 PMe: /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
Rachel
10/27/2019, 5:23 PMExample.kt
files, you'll see the source code with |
.Rachel
10/27/2019, 5:23 PM|
from code snippets (it's already done in testing-plugin
).Rachel
10/27/2019, 5:23 PMcompileSourceCode(EQ_FUNCTION.trimMargin())
...
compileSourceCode(EQ_EXTENSION.trimMargin())
Rachel
10/27/2019, 5:24 PMextension
annotation at the beginning of each snippet:
| import arrow.extension
Rachel
10/27/2019, 5:24 PMRachel
10/27/2019, 5:24 PMamanda.hinchman-dominguez
10/27/2019, 5:28 PMamanda.hinchman-dominguez
10/27/2019, 5:28 PMamanda.hinchman-dominguez
10/27/2019, 5:30 PMcom.github.arrow-kt:kotlin-compile-testing:1.2.3-SNAPSHOT
amanda.hinchman-dominguez
10/27/2019, 5:30 PMRachel
10/27/2019, 5:49 PMRachel
10/27/2019, 5:50 PMclasspaths = listOf(classpathOf("arrow-annotations:rr-meta-prototype-integration-SNAPSHOT"))
Rachel
10/27/2019, 5:50 PMRachel
10/27/2019, 5:50 PMclasspaths = listOf(classpathOf("arrow-meta-prototype:rr-meta-prototype-integration-SNAPSHOT"))
Rachel
10/27/2019, 5:50 PMRachel
10/27/2019, 5:50 PMcompileSourceCode(EQ_FUNCTION.trimMargin())
...
compileSourceCode(EQ_EXTENSION.trimMargin())
Rachel
10/27/2019, 5:50 PMamanda.hinchman-dominguez
10/27/2019, 8:16 PMamanda.hinchman-dominguez
10/27/2019, 8:17 PM|
from the comments for compiling source code?Rachel
10/27/2019, 9:46 PMRachel
10/27/2019, 9:47 PMmaster
branch, you'll get a new way to add the test you're looking for: just checking that it compilesRachel
10/27/2019, 9:47 PMRachel
10/27/2019, 9:51 PMval 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
}
))
Rachel
10/27/2019, 9:52 PMamanda.hinchman-dominguez
10/27/2019, 11:22 PMamanda.hinchman-dominguez
10/27/2019, 11:22 PM