aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt
diff options
context:
space:
mode:
Diffstat (limited to 'integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt')
-rw-r--r--integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt42
1 files changed, 42 insertions, 0 deletions
diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt
new file mode 100644
index 00000000..52a62a4d
--- /dev/null
+++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/VersionCheckIT.kt
@@ -0,0 +1,42 @@
+package com.google.devtools.ksp.test
+
+import org.gradle.testkit.runner.GradleRunner
+import org.junit.Assert
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+
+@Ignore
+class VersionCheckIT {
+ @Rule
+ @JvmField
+ val project: TemporaryTestProject = TemporaryTestProject("playground")
+
+ @Test
+ fun testVersion() {
+ val gradleRunner = GradleRunner.create().withProjectDir(project.root)
+ val result = gradleRunner.withArguments(
+ "-PkotlinVersion=1.4.20", "clean", "build"
+ ).buildAndFail()
+ Assert.assertTrue(result.output.contains("is too new for kotlin"))
+ }
+
+ @Test
+ fun testVersionOK() {
+ val gradleRunner = GradleRunner.create().withProjectDir(project.root)
+ val result = gradleRunner.withArguments(
+ "clean", "build"
+ ).build()
+ Assert.assertFalse(result.output.contains("is too new for kotlin"))
+ Assert.assertFalse(result.output.contains("is too old for kotlin"))
+ }
+
+ @Test
+ fun testMuteVersionCheck() {
+ val gradleRunner = GradleRunner.create().withProjectDir(project.root)
+ val result = gradleRunner.withArguments(
+ "-PkotlinVersion=1.4.20", "-Pksp.version.check=false", "clean", "build"
+ ).buildAndFail()
+ Assert.assertFalse(result.output.contains("is too new for kotlin"))
+ }
+}