aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickreid <nickreid@google.com>2022-11-30 14:37:53 -0800
committerCopybara-Service <copybara-worker@google.com>2022-11-30 14:38:35 -0800
commit441ec46966b3472e30bfa421d2731e55a23f56e2 (patch)
treed1469bdac2c49d071ad6d19ca0891c431d04d995
parent56c10aaaa7c6d24070b418dcd5a6918bd98cb692 (diff)
downloadbazelbuild-kotlin-rules-441ec46966b3472e30bfa421d2731e55a23f56e2.tar.gz
Move the kt_jvm_library no-deps analysis test into a separate file.
This is an example for the general process of eliminating the inline analysis tests. PiperOrigin-RevId: 492021336 Change-Id: Ief222cc7d9f4ce1f734714579645b577e4402dac
-rw-r--r--tests/analysis/jvm_library/nodeps/BUILD27
-rw-r--r--tests/analysis/jvm_library/nodeps/Input.kt16
-rw-r--r--tests/analysis/jvm_library_test.bzl24
3 files changed, 43 insertions, 24 deletions
diff --git a/tests/analysis/jvm_library/nodeps/BUILD b/tests/analysis/jvm_library/nodeps/BUILD
new file mode 100644
index 0000000..042da91
--- /dev/null
+++ b/tests/analysis/jvm_library/nodeps/BUILD
@@ -0,0 +1,27 @@
+# Copyright 2022 Google LLC. 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.
+
+load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test", "kt_jvm_library_under_test")
+
+package(default_testonly = True)
+
+licenses(["notice"])
+
+jvm_library_test(
+ name = "nodeps_test",
+ target_under_test = kt_jvm_library_under_test(
+ name = "nodeps",
+ srcs = ["Input.kt"],
+ ),
+)
diff --git a/tests/analysis/jvm_library/nodeps/Input.kt b/tests/analysis/jvm_library/nodeps/Input.kt
new file mode 100644
index 0000000..e675bc1
--- /dev/null
+++ b/tests/analysis/jvm_library/nodeps/Input.kt
@@ -0,0 +1,16 @@
+/*
+ * * Copyright 2022 Google LLC. 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.
+ */
+
diff --git a/tests/analysis/jvm_library_test.bzl b/tests/analysis/jvm_library_test.bzl
index 5e4eebb..508d438 100644
--- a/tests/analysis/jvm_library_test.bzl
+++ b/tests/analysis/jvm_library_test.bzl
@@ -189,29 +189,6 @@ fun hi(): String = "Hi!"
)
return test_name
-def _test_kt_jvm_library_no_deps():
- test_name = "kt_jvm_library_no_deps_test"
- create_file(
- name = test_name + "/Salutations.kt",
- content = """
-package test
-
-fun greeting(): String = "Hello World!"
-""",
- )
- kt_jvm_library(
- name = test_name + "_tut",
- srcs = [
- "testinputs/Bar.java",
- test_name + "/Salutations.kt",
- ],
- )
- _test(
- name = test_name,
- target_under_test = test_name + "_tut",
- )
- return test_name
-
def _test_kt_jvm_library_with_only_common_srcs():
test_name = "kt_jvm_library_only_common_srcs_test"
create_file(
@@ -824,7 +801,6 @@ def test_suite(name):
_test_forbidden_nano_export(),
_test_kt_jvm_library_dep_on_exported_plugin(),
_test_kt_jvm_library_java_dep_on_exported_plugin(),
- _test_kt_jvm_library_no_deps(),
_test_kt_jvm_library_no_java_srcs(),
_test_kt_jvm_library_no_kt_srcs(),
_test_kt_jvm_library_no_kt_srcs_with_plugin(),