From d7405abd94d93be2d45fe7ef072666655913e148 Mon Sep 17 00:00:00 2001 From: raghulvelusamy Date: Mon, 18 Dec 2023 23:51:21 -0800 Subject: [PATCH] Move tests to assertion test --- src/test/data/jvm/ksp/BUILD | 13 +++++++++++++ src/test/kotlin/io/bazel/kotlin/BUILD | 7 +++++++ ...erJvmKspTest.kt => KotlinJvmKspAssertionTest.kt} | 5 ++--- .../io/bazel/kotlin/builder/tasks/BUILD.bazel | 9 +-------- 4 files changed, 23 insertions(+), 11 deletions(-) rename src/test/kotlin/io/bazel/kotlin/{builder/tasks/jvm/KotlinBuilderJvmKspTest.kt => KotlinJvmKspAssertionTest.kt} (89%) diff --git a/src/test/data/jvm/ksp/BUILD b/src/test/data/jvm/ksp/BUILD index ddde7233e..b9052e7b7 100644 --- a/src/test/data/jvm/ksp/BUILD +++ b/src/test/data/jvm/ksp/BUILD @@ -1,6 +1,19 @@ load("//kotlin:core.bzl", "kt_ksp_plugin") load("//kotlin:jvm.bzl", "kt_jvm_library") +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. package(default_visibility = ["//visibility:private"]) kt_ksp_plugin( diff --git a/src/test/kotlin/io/bazel/kotlin/BUILD b/src/test/kotlin/io/bazel/kotlin/BUILD index f87a75b32..2ac635bd5 100644 --- a/src/test/kotlin/io/bazel/kotlin/BUILD +++ b/src/test/kotlin/io/bazel/kotlin/BUILD @@ -62,6 +62,12 @@ kt_rules_e2e_test( srcs = ["KotlinJvm13Test.kt"], ) +kt_rules_e2e_test( + name = "KotlinJvmKspAssertionTest", + srcs = ["KotlinJvmKspAssertionTest.kt"], + data = ["//src/test/data/jvm/ksp"], +) + test_suite( name = "assertion_tests", tests = [ @@ -69,6 +75,7 @@ test_suite( "KotlinJvmAssociatesBasicVisibilityTest", "KotlinJvmBasicAssertionTest", "KotlinJvmKaptAssertionTest", + "KotlinJvmKspAssertionTest", ], ) diff --git a/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKspTest.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt similarity index 89% rename from src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKspTest.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt index 2f8039669..4966df3bd 100644 --- a/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKspTest.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt @@ -1,12 +1,11 @@ -package io.bazel.kotlin.builder.tasks.jvm +package io.bazel.kotlin -import io.bazel.kotlin.KotlinAssertionTestCase import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 @RunWith(JUnit4::class) -class KotlinBuilderJvmKspTest: KotlinAssertionTestCase("src/test/data/jvm/ksp") { +class KotlinJvmKspAssertionTest: KotlinAssertionTestCase("src/test/data/jvm/ksp") { @Test fun testKSPCopiesAllFilesFromMetaINF() { diff --git a/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel b/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel index 0f71b855c..d7e8cd0f5 100644 --- a/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel +++ b/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@rules_java//java:defs.bzl", "java_library") -load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_e2e_test", "kt_rules_test") +load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") java_library( name = "JdepsParserTestFixtures", @@ -107,12 +107,6 @@ kt_rules_test( ], ) -kt_rules_e2e_test( - name = "KotlinKSPMetaFilesCopyTest", - srcs = ["jvm/KotlinBuilderJvmKspTest.kt"], - data = ["//src/test/data/jvm/ksp"], -) - test_suite( name = "tasks_tests", tests = [ @@ -126,6 +120,5 @@ test_suite( ":KotlinBuilderJvmKaptTest", ":KotlinBuilderJvmStrictDepsTest", ":KotlinJvmTaskExecutorTest", - ":KotlinKSPMetaFilesCopyTest", ], )