Skip to content

Commit

Permalink
Add missing KotlinJvmTaskExecutorTest to the test suite (#1089)
Browse files Browse the repository at this point in the history
* Add missing KotlinJvmTaskExecutorTest to the test suite

Add missing KotlinJvmTaskExecutorTest to the test suite

* Make fun public to expose to test

* Fix test

* Pass dep as associate deps

* Revert "Pass dep as associate deps"

This reverts commit 4f0b728.
  • Loading branch information
raghulvelusamy committed Dec 12, 2023
1 parent e06ba90 commit 6c8723f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ private val Directories.incrementalData
* Create a new [JvmCompilationTask] with sources found in the generatedSources directory. This should be run after
* annotation processors have been run.
*/
internal fun JvmCompilationTask.expandWithGeneratedSources(): JvmCompilationTask =
fun JvmCompilationTask.expandWithGeneratedSources(): JvmCompilationTask =
expandWithSources(
Stream.of(directories.generatedSources, directories.generatedJavaSources)
.map { s -> Paths.get(s) }
Expand Down
11 changes: 11 additions & 0 deletions src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ kt_rules_test(
],
)

kt_rules_test(
name = "KotlinJvmTaskExecutorTest",
srcs = ["jvm/KotlinJvmTaskExecutorTest.kt"],
deps = [
"//kotlin/compiler:kotlin-test",
"//src/main/kotlin/io/bazel/kotlin/builder/tasks",
"@kotlin_rules_maven//:junit_junit",
],
)

test_suite(
name = "tasks_tests",
tests = [
Expand All @@ -109,5 +119,6 @@ test_suite(
":KotlinBuilderJvmJdepsTest",
":KotlinBuilderJvmKaptTest",
":KotlinBuilderJvmStrictDepsTest",
":KotlinJvmTaskExecutorTest",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class KotlinJvmTaskExecutorTest {

assertTrue(expandedCompileTask.hasInputs())
assertNotNull(expandedCompileTask.inputs.javaSourcesList.find { path ->
path.endsWith("a_test_1/generated_sources/AnotherGenClass.java")
path.endsWith("generated_sources/AnotherGenClass.java")
})
assertEquals(expandedCompileTask.inputs.javaSourcesCount, 1)
assertNotNull(expandedCompileTask.inputs.kotlinSourcesList.find { path ->
path.endsWith("a_test_1/generated_sources/AGenClass.kt")
path.endsWith("generated_sources/AGenClass.kt")
})
assertEquals(expandedCompileTask.inputs.kotlinSourcesCount, 1)
}
Expand Down

0 comments on commit 6c8723f

Please sign in to comment.