aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickreid <nickreid@google.com>2023-10-11 14:23:25 -0700
committerCopybara-Service <copybara-worker@google.com>2023-10-11 14:23:57 -0700
commit0036968d46982b9f777ea92804c48d8f632e75b5 (patch)
treec8cd9c4a2aa6f8a1ebcde502e896d790cc640a03
parent9c4ccede1d32c03819afd68269025ea4685dd2fe (diff)
downloadbazelbuild-kotlin-rules-0036968d46982b9f777ea92804c48d8f632e75b5.tar.gz
Move some analysis tests to tests/jvm/analysis
PiperOrigin-RevId: 572686226
-rw-r--r--tests/analysis/BUILD4
-rw-r--r--tests/analysis/jvm_library/deps/Foo.java16
-rw-r--r--tests/analysis/jvm_library/no_java_srcs/BUILD32
-rw-r--r--tests/analysis/jvm_library/no_kt_srcs/BUILD32
-rw-r--r--tests/analysis/jvm_library/nodeps/BUILD33
-rw-r--r--tests/analysis/jvm_library/only_common_srcs/Input.kt16
-rw-r--r--tests/analysis/jvm_library/runtime_deps/Input.kt16
-rw-r--r--tests/analysis/jvm_library/treeartifacts_srcs/Input.java16
-rw-r--r--tests/analysis/jvm_library/treeartifacts_srcs/Input.kt16
-rw-r--r--tests/analysis/jvm_library_test.bzl2
-rw-r--r--tests/jvm/analysis/jvm_library/data/BUILD (renamed from tests/analysis/jvm_library/data/BUILD)5
-rw-r--r--tests/jvm/analysis/jvm_library/data/Input.kt (renamed from tests/analysis/jvm_library/deps/Input.kt)1
-rw-r--r--tests/jvm/analysis/jvm_library/data/data.txt (renamed from tests/analysis/jvm_library/data/data.txt)0
-rw-r--r--tests/jvm/analysis/jvm_library/deps/BUILD (renamed from tests/analysis/jvm_library/deps/BUILD)42
-rw-r--r--tests/jvm/analysis/jvm_library/deps/Input.java (renamed from tests/analysis/jvm_library/deps/Input.java)0
-rw-r--r--tests/jvm/analysis/jvm_library/deps/Input.kt (renamed from tests/analysis/jvm_library/data/Input.kt)1
-rw-r--r--tests/jvm/analysis/jvm_library/friends/BUILD (renamed from tests/analysis/jvm_library/friends/BUILD)48
-rw-r--r--tests/jvm/analysis/jvm_library/friends/Input.java (renamed from tests/analysis/jvm_library/friends/Input.java)0
-rw-r--r--tests/jvm/analysis/jvm_library/friends/Input.kt (renamed from tests/analysis/jvm_library/friends/Input.kt)0
-rw-r--r--tests/jvm/analysis/jvm_library/friends/sub/BUILD (renamed from tests/analysis/jvm_library/friends/sub/BUILD)13
-rw-r--r--tests/jvm/analysis/jvm_library/friends/sub/Input.kt (renamed from tests/analysis/jvm_library/friends/sub/Input.kt)0
-rw-r--r--tests/jvm/analysis/jvm_library/friends/testing/BUILD (renamed from tests/analysis/jvm_library/friends/testing/BUILD)21
-rw-r--r--tests/jvm/analysis/jvm_library/friends/testing/Input.kt (renamed from tests/analysis/jvm_library/friends/testing/Input.kt)0
-rw-r--r--tests/jvm/analysis/jvm_library/no_srcs/BUILD53
-rw-r--r--tests/jvm/analysis/jvm_library/no_srcs/Input.java (renamed from tests/analysis/jvm_library/no_kt_srcs/Input.java)0
-rw-r--r--tests/jvm/analysis/jvm_library/no_srcs/Input.kt (renamed from tests/analysis/jvm_library/no_java_srcs/Input.kt)1
-rw-r--r--tests/jvm/analysis/jvm_library/only_common_srcs/BUILD (renamed from tests/analysis/jvm_library/only_common_srcs/BUILD)5
-rw-r--r--tests/jvm/analysis/jvm_library/only_common_srcs/Input.kt (renamed from tests/analysis/jvm_library/nodeps/Input.kt)1
-rw-r--r--tests/jvm/analysis/jvm_library/runtime_deps/BUILD (renamed from tests/analysis/jvm_library/runtime_deps/BUILD)5
-rw-r--r--tests/jvm/analysis/jvm_library/runtime_deps/Input.java (renamed from tests/analysis/jvm_library/nodeps/Input.java)0
-rw-r--r--tests/jvm/analysis/jvm_library/runtime_deps/Input.kt17
-rw-r--r--tests/jvm/analysis/jvm_library/treeartifacts_srcs/BUILD (renamed from tests/analysis/jvm_library/treeartifacts_srcs/BUILD)0
-rw-r--r--tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.java (renamed from tests/analysis/jvm_library/runtime_deps/Input.java)0
-rw-r--r--tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.kt17
-rw-r--r--tests/jvm/java/neverlink/BUILD4
35 files changed, 171 insertions, 246 deletions
diff --git a/tests/analysis/BUILD b/tests/analysis/BUILD
index 0533e13..5a90903 100644
--- a/tests/analysis/BUILD
+++ b/tests/analysis/BUILD
@@ -16,13 +16,13 @@
load("//tests/analysis:jvm_compile_test.bzl", jvm_compile_test_suite = "test_suite")
load("//tests/analysis:jvm_import_test.bzl", jvm_import_test_suite = "test_suite")
-load("//tests/analysis:jvm_library_test.bzl", jvm_library_test_suite = "test_suite")
+load("//tests/analysis:jvm_library_test.bzl", kt_jvm_library_analysis_test_suite = "test_suite")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
licenses(["notice"])
jvm_compile_test_suite(name = "jvm_compile_tests")
-jvm_library_test_suite(name = "jvm_library_tests")
+kt_jvm_library_analysis_test_suite(name = "kt_jvm_library_analysis_tests")
jvm_import_test_suite(name = "jvm_import_tests")
diff --git a/tests/analysis/jvm_library/deps/Foo.java b/tests/analysis/jvm_library/deps/Foo.java
deleted file mode 100644
index e675bc1..0000000
--- a/tests/analysis/jvm_library/deps/Foo.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * * 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/no_java_srcs/BUILD b/tests/analysis/jvm_library/no_java_srcs/BUILD
deleted file mode 100644
index 66f6fdc..0000000
--- a/tests/analysis/jvm_library/no_java_srcs/BUILD
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-
-package(
- default_testonly = True,
-)
-
-licenses(["notice"])
-
-jvm_library_test(
- name = "no_java_srcs_test",
- target_under_test = kt_for_analysis.kt_jvm_library(
- name = "no_java_srcs",
- srcs = [
- "Input.kt",
- ],
- ),
-)
diff --git a/tests/analysis/jvm_library/no_kt_srcs/BUILD b/tests/analysis/jvm_library/no_kt_srcs/BUILD
deleted file mode 100644
index 201b669..0000000
--- a/tests/analysis/jvm_library/no_kt_srcs/BUILD
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-
-package(
- default_testonly = True,
-)
-
-licenses(["notice"])
-
-jvm_library_test(
- name = "no_kt_srcs_test",
- target_under_test = kt_for_analysis.kt_jvm_library(
- name = "no_kt_srcs",
- srcs = [
- "Input.java",
- ],
- ),
-)
diff --git a/tests/analysis/jvm_library/nodeps/BUILD b/tests/analysis/jvm_library/nodeps/BUILD
deleted file mode 100644
index 90c88a5..0000000
--- a/tests/analysis/jvm_library/nodeps/BUILD
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-
-package(
- default_testonly = True,
-)
-
-licenses(["notice"])
-
-jvm_library_test(
- name = "nodeps_test",
- target_under_test = kt_for_analysis.kt_jvm_library(
- name = "nodeps",
- srcs = [
- "Input.java",
- "Input.kt",
- ],
- ),
-)
diff --git a/tests/analysis/jvm_library/only_common_srcs/Input.kt b/tests/analysis/jvm_library/only_common_srcs/Input.kt
deleted file mode 100644
index e675bc1..0000000
--- a/tests/analysis/jvm_library/only_common_srcs/Input.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * * 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/runtime_deps/Input.kt b/tests/analysis/jvm_library/runtime_deps/Input.kt
deleted file mode 100644
index e675bc1..0000000
--- a/tests/analysis/jvm_library/runtime_deps/Input.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * * 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/treeartifacts_srcs/Input.java b/tests/analysis/jvm_library/treeartifacts_srcs/Input.java
deleted file mode 100644
index e675bc1..0000000
--- a/tests/analysis/jvm_library/treeartifacts_srcs/Input.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * * 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/treeartifacts_srcs/Input.kt b/tests/analysis/jvm_library/treeartifacts_srcs/Input.kt
deleted file mode 100644
index e675bc1..0000000
--- a/tests/analysis/jvm_library/treeartifacts_srcs/Input.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * * 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 e68afd5..3fe1b75 100644
--- a/tests/analysis/jvm_library_test.bzl
+++ b/tests/analysis/jvm_library_test.bzl
@@ -22,8 +22,6 @@ load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
visibility(RULES_KOTLIN)
-jvm_library_test = kt_jvm_library_analysis_test
-
def _coverage_test_impl(ctx):
env = analysistest.begin(ctx)
target_under_test = analysistest.target_under_test(env)
diff --git a/tests/analysis/jvm_library/data/BUILD b/tests/jvm/analysis/jvm_library/data/BUILD
index ecc2760..92350c0 100644
--- a/tests/analysis/jvm_library/data/BUILD
+++ b/tests/jvm/analysis/jvm_library/data/BUILD
@@ -13,15 +13,16 @@
# limitations under the License.
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
)
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "data_test",
expected_runfile_names = [
"data.txt",
diff --git a/tests/analysis/jvm_library/deps/Input.kt b/tests/jvm/analysis/jvm_library/data/Input.kt
index e675bc1..963d749 100644
--- a/tests/analysis/jvm_library/deps/Input.kt
+++ b/tests/jvm/analysis/jvm_library/data/Input.kt
@@ -14,3 +14,4 @@
* limitations under the License.
*/
+
diff --git a/tests/analysis/jvm_library/data/data.txt b/tests/jvm/analysis/jvm_library/data/data.txt
index e3ba5e8..e3ba5e8 100644
--- a/tests/analysis/jvm_library/data/data.txt
+++ b/tests/jvm/analysis/jvm_library/data/data.txt
diff --git a/tests/analysis/jvm_library/deps/BUILD b/tests/jvm/analysis/jvm_library/deps/BUILD
index d733b84..fb01c01 100644
--- a/tests/analysis/jvm_library/deps/BUILD
+++ b/tests/jvm/analysis/jvm_library/deps/BUILD
@@ -13,34 +13,32 @@
# limitations under the License.
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
)
licenses(["notice"])
-kt_for_analysis.kt_jvm_library(
- name = "deps_test_kt_dep",
- srcs = [
- "Input.kt",
- ],
-)
-
-kt_for_analysis.java_library(
- name = "deps_test_java_dep",
- srcs = [
- "Input.java",
- ],
+kt_jvm_library_analysis_test(
+ name = "no_deps_test",
+ target_under_test = kt_for_analysis.kt_jvm_library(
+ name = "no_deps",
+ srcs = [
+ "Input.java",
+ "Input.kt",
+ ],
+ ),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "deps_test",
target_under_test = kt_for_analysis.kt_jvm_library(
name = "deps",
srcs = [
- "Foo.java",
+ "Input.java",
],
deps = [
":deps_test_java_dep",
@@ -48,3 +46,17 @@ jvm_library_test(
],
),
)
+
+kt_for_analysis.kt_jvm_library(
+ name = "deps_test_kt_dep",
+ srcs = [
+ "Input.kt",
+ ],
+)
+
+kt_for_analysis.java_library(
+ name = "deps_test_java_dep",
+ srcs = [
+ "Input.java",
+ ],
+)
diff --git a/tests/analysis/jvm_library/deps/Input.java b/tests/jvm/analysis/jvm_library/deps/Input.java
index e675bc1..e675bc1 100644
--- a/tests/analysis/jvm_library/deps/Input.java
+++ b/tests/jvm/analysis/jvm_library/deps/Input.java
diff --git a/tests/analysis/jvm_library/data/Input.kt b/tests/jvm/analysis/jvm_library/deps/Input.kt
index e675bc1..963d749 100644
--- a/tests/analysis/jvm_library/data/Input.kt
+++ b/tests/jvm/analysis/jvm_library/deps/Input.kt
@@ -14,3 +14,4 @@
* limitations under the License.
*/
+
diff --git a/tests/analysis/jvm_library/friends/BUILD b/tests/jvm/analysis/jvm_library/friends/BUILD
index aac0ad5..f2454f4 100644
--- a/tests/analysis/jvm_library/friends/BUILD
+++ b/tests/jvm/analysis/jvm_library/friends/BUILD
@@ -12,103 +12,99 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//kotlin:rules.bzl", "kt_jvm_library")
-load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
-load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
+load("//kotlin/jvm/testing:for_analysis.bzl", ktfa = "kt_for_analysis")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
- default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"],
+ default_visibility = ["//tests/jvm/analysis/jvm_library/friends:__subpackages__"],
)
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_kt_exported_friend_cross_package_test",
expected_friend_jar_names = [],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "no_kt_exported_friend_cross_package",
srcs = ["Input.kt"],
deps = [
# Exports :friend from this package
- "//tests/analysis/jvm_library/friends/sub:kt_exports_friend",
+ "//tests/jvm/analysis/jvm_library/friends/sub:kt_exports_friend",
],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "has_java_exported_friend_in_package_test",
expected_friend_jar_names = [
"libjava_exports_friend-hjar.jar",
"libfriend-compile.jar",
],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "has_java_exported_friend_in_package",
srcs = ["Input.kt"],
deps = [":java_exports_friend"],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "has_kt_exported_friend_in_package_test",
expected_friend_jar_names = [
"libkt_exports_friend-compile.jar",
"libfriend-compile.jar",
],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "has_kt_exported_friend_in_package",
srcs = ["Input.kt"],
deps = [":kt_exports_friend"],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_direct_friend_testing_package_test",
expected_friend_jar_names = [],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "no_direct_friend_testing_package",
srcs = ["Input.kt"],
- deps = ["//tests/analysis/jvm_library/friends/testing:testingfriend"],
+ deps = ["//tests/jvm/analysis/jvm_library/friends/testing:testingfriend"],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_direct_friend_subpackage_test",
expected_friend_jar_names = [],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "no_direct_friend_subpackage",
srcs = ["Input.kt"],
- deps = ["//tests/analysis/jvm_library/friends/sub:subfriend"],
+ deps = ["//tests/jvm/analysis/jvm_library/friends/sub:subfriend"],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "has_direct_friend_in_package_test",
expected_friend_jar_names = ["libfriend-compile.jar"],
- target_under_test = kt_for_analysis.kt_jvm_library(
+ target_under_test = ktfa.kt_jvm_library(
name = "has_direct_friend_in_package",
srcs = ["Input.kt"],
deps = [":friend"],
),
)
-java_library(
+ktfa.java_library(
name = "java_exports_friend",
srcs = ["Input.java"],
- tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
exports = [":friend"],
)
-kt_jvm_library(
+ktfa.kt_jvm_library(
name = "kt_exports_friend",
srcs = ["Input.kt"],
- tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
exports = [":friend"],
)
-kt_jvm_library(
+ktfa.kt_jvm_library(
name = "friend",
srcs = ["Input.kt"],
- tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
)
diff --git a/tests/analysis/jvm_library/friends/Input.java b/tests/jvm/analysis/jvm_library/friends/Input.java
index 5bf1d18..5bf1d18 100644
--- a/tests/analysis/jvm_library/friends/Input.java
+++ b/tests/jvm/analysis/jvm_library/friends/Input.java
diff --git a/tests/analysis/jvm_library/friends/Input.kt b/tests/jvm/analysis/jvm_library/friends/Input.kt
index b1a99cb..b1a99cb 100644
--- a/tests/analysis/jvm_library/friends/Input.kt
+++ b/tests/jvm/analysis/jvm_library/friends/Input.kt
diff --git a/tests/analysis/jvm_library/friends/sub/BUILD b/tests/jvm/analysis/jvm_library/friends/sub/BUILD
index d009501..d71eb2b 100644
--- a/tests/analysis/jvm_library/friends/sub/BUILD
+++ b/tests/jvm/analysis/jvm_library/friends/sub/BUILD
@@ -14,17 +14,18 @@
load("//kotlin:rules.bzl", "kt_jvm_library")
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
- default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"],
+ default_visibility = ["//tests/jvm/analysis/jvm_library/friends:__subpackages__"],
)
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_kt_exported_friend_cross_package_test",
expected_friend_jar_names = [
"libkt_exports_friend-compile.jar",
@@ -37,13 +38,13 @@ jvm_library_test(
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_direct_friend_cross_package_test",
expected_friend_jar_names = [],
target_under_test = kt_for_analysis.kt_jvm_library(
name = "no_direct_friend_cross_package",
srcs = ["Input.kt"],
- deps = ["//tests/analysis/jvm_library/friends:friend"],
+ deps = ["//tests/jvm/analysis/jvm_library/friends:friend"],
),
)
@@ -51,7 +52,7 @@ kt_jvm_library(
name = "kt_exports_friend",
srcs = ["Input.kt"],
tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
- exports = ["//tests/analysis/jvm_library/friends:friend"],
+ exports = ["//tests/jvm/analysis/jvm_library/friends:friend"],
)
kt_jvm_library(
diff --git a/tests/analysis/jvm_library/friends/sub/Input.kt b/tests/jvm/analysis/jvm_library/friends/sub/Input.kt
index 4c87a1e..4c87a1e 100644
--- a/tests/analysis/jvm_library/friends/sub/Input.kt
+++ b/tests/jvm/analysis/jvm_library/friends/sub/Input.kt
diff --git a/tests/analysis/jvm_library/friends/testing/BUILD b/tests/jvm/analysis/jvm_library/friends/testing/BUILD
index 71ce0bc..cd93965 100644
--- a/tests/analysis/jvm_library/friends/testing/BUILD
+++ b/tests/jvm/analysis/jvm_library/friends/testing/BUILD
@@ -14,17 +14,18 @@
load("//kotlin:rules.bzl", "kt_jvm_library")
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
- default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"],
+ default_visibility = ["//tests/jvm/analysis/jvm_library/friends:__subpackages__"],
)
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "has_kt_exported_friend_impl_package_test",
expected_friend_jar_names = [
"libkt_exports_friend-compile.jar",
@@ -37,7 +38,7 @@ jvm_library_test(
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "has_direct_friend_impl_package_test",
expected_friend_jar_names = [
"libfriend-compile.jar",
@@ -45,11 +46,11 @@ jvm_library_test(
target_under_test = kt_for_analysis.kt_jvm_library(
name = "has_direct_friend_impl_package",
srcs = ["Input.kt"],
- deps = ["//tests/analysis/jvm_library/friends:friend"],
+ deps = ["//tests/jvm/analysis/jvm_library/friends:friend"],
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_kt_exported_friend_sibling_package_test",
expected_friend_jar_names = [
"libkt_exports_subfriend-compile.jar",
@@ -62,13 +63,13 @@ jvm_library_test(
),
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "no_direct_friend_sibling_package_test",
expected_friend_jar_names = [],
target_under_test = kt_for_analysis.kt_jvm_library(
name = "no_direct_friend_sibling_package",
srcs = ["Input.kt"],
- deps = ["//tests/analysis/jvm_library/friends/sub:subfriend"],
+ deps = ["//tests/jvm/analysis/jvm_library/friends/sub:subfriend"],
),
)
@@ -76,14 +77,14 @@ kt_jvm_library(
name = "kt_exports_subfriend",
srcs = ["Input.kt"],
tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
- exports = ["//tests/analysis/jvm_library/friends/sub:subfriend"],
+ exports = ["//tests/jvm/analysis/jvm_library/friends/sub:subfriend"],
)
kt_jvm_library(
name = "kt_exports_friend",
srcs = ["Input.kt"],
tags = ONLY_FOR_ANALYSIS_TEST_TAGS,
- exports = ["//tests/analysis/jvm_library/friends:friend"],
+ exports = ["//tests/jvm/analysis/jvm_library/friends:friend"],
)
kt_jvm_library(
diff --git a/tests/analysis/jvm_library/friends/testing/Input.kt b/tests/jvm/analysis/jvm_library/friends/testing/Input.kt
index 2c65124..2c65124 100644
--- a/tests/analysis/jvm_library/friends/testing/Input.kt
+++ b/tests/jvm/analysis/jvm_library/friends/testing/Input.kt
diff --git a/tests/jvm/analysis/jvm_library/no_srcs/BUILD b/tests/jvm/analysis/jvm_library/no_srcs/BUILD
new file mode 100644
index 0000000..f0a3a30
--- /dev/null
+++ b/tests/jvm/analysis/jvm_library/no_srcs/BUILD
@@ -0,0 +1,53 @@
+# 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("//kotlin/common/testing:testing_rules.bzl", "kt_testing_rules")
+load("//kotlin/jvm/testing:for_analysis.bzl", ktfa = "kt_for_analysis")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
+
+package(
+ default_applicable_licenses = ["//:license"],
+ default_testonly = True,
+)
+
+licenses(["notice"])
+
+kt_testing_rules.assert_failure_test(
+ name = "no_srcs_test",
+ msg_contains = "Expected a source-bearing or an export-oriented target",
+ target_under_test = ktfa.kt_jvm_library(
+ name = "no_srcs",
+ srcs = [],
+ ),
+)
+
+kt_jvm_library_analysis_test(
+ name = "only_kt_srcs_test",
+ target_under_test = ktfa.kt_jvm_library(
+ name = "only_kt_srcs",
+ srcs = [
+ "Input.kt",
+ ],
+ ),
+)
+
+kt_jvm_library_analysis_test(
+ name = "only_java_srcs_test",
+ target_under_test = ktfa.kt_jvm_library(
+ name = "only_java_srcs",
+ srcs = [
+ "Input.java",
+ ],
+ ),
+)
diff --git a/tests/analysis/jvm_library/no_kt_srcs/Input.java b/tests/jvm/analysis/jvm_library/no_srcs/Input.java
index e675bc1..e675bc1 100644
--- a/tests/analysis/jvm_library/no_kt_srcs/Input.java
+++ b/tests/jvm/analysis/jvm_library/no_srcs/Input.java
diff --git a/tests/analysis/jvm_library/no_java_srcs/Input.kt b/tests/jvm/analysis/jvm_library/no_srcs/Input.kt
index e675bc1..963d749 100644
--- a/tests/analysis/jvm_library/no_java_srcs/Input.kt
+++ b/tests/jvm/analysis/jvm_library/no_srcs/Input.kt
@@ -14,3 +14,4 @@
* limitations under the License.
*/
+
diff --git a/tests/analysis/jvm_library/only_common_srcs/BUILD b/tests/jvm/analysis/jvm_library/only_common_srcs/BUILD
index c26bcee..a91cff7 100644
--- a/tests/analysis/jvm_library/only_common_srcs/BUILD
+++ b/tests/jvm/analysis/jvm_library/only_common_srcs/BUILD
@@ -13,15 +13,16 @@
# limitations under the License.
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
)
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "only_common_srcs_test",
target_under_test = kt_for_analysis.kt_jvm_library(
name = "only_common_srcs",
diff --git a/tests/analysis/jvm_library/nodeps/Input.kt b/tests/jvm/analysis/jvm_library/only_common_srcs/Input.kt
index e675bc1..963d749 100644
--- a/tests/analysis/jvm_library/nodeps/Input.kt
+++ b/tests/jvm/analysis/jvm_library/only_common_srcs/Input.kt
@@ -14,3 +14,4 @@
* limitations under the License.
*/
+
diff --git a/tests/analysis/jvm_library/runtime_deps/BUILD b/tests/jvm/analysis/jvm_library/runtime_deps/BUILD
index 5e17e71..aaea117 100644
--- a/tests/analysis/jvm_library/runtime_deps/BUILD
+++ b/tests/jvm/analysis/jvm_library/runtime_deps/BUILD
@@ -13,9 +13,10 @@
# limitations under the License.
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
package(
+ default_applicable_licenses = ["//:license"],
default_testonly = True,
)
@@ -26,7 +27,7 @@ kt_for_analysis.java_library(
srcs = [],
)
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "runtime_deps_test",
target_under_test = kt_for_analysis.kt_jvm_library(
name = "runtime_deps",
diff --git a/tests/analysis/jvm_library/nodeps/Input.java b/tests/jvm/analysis/jvm_library/runtime_deps/Input.java
index e675bc1..e675bc1 100644
--- a/tests/analysis/jvm_library/nodeps/Input.java
+++ b/tests/jvm/analysis/jvm_library/runtime_deps/Input.java
diff --git a/tests/jvm/analysis/jvm_library/runtime_deps/Input.kt b/tests/jvm/analysis/jvm_library/runtime_deps/Input.kt
new file mode 100644
index 0000000..963d749
--- /dev/null
+++ b/tests/jvm/analysis/jvm_library/runtime_deps/Input.kt
@@ -0,0 +1,17 @@
+/*
+ * * 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/treeartifacts_srcs/BUILD b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/BUILD
index 6151a43..6151a43 100644
--- a/tests/analysis/jvm_library/treeartifacts_srcs/BUILD
+++ b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/BUILD
diff --git a/tests/analysis/jvm_library/runtime_deps/Input.java b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.java
index e675bc1..e675bc1 100644
--- a/tests/analysis/jvm_library/runtime_deps/Input.java
+++ b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.java
diff --git a/tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.kt b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.kt
new file mode 100644
index 0000000..963d749
--- /dev/null
+++ b/tests/jvm/analysis/jvm_library/treeartifacts_srcs/Input.kt
@@ -0,0 +1,17 @@
+/*
+ * * 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/jvm/java/neverlink/BUILD b/tests/jvm/java/neverlink/BUILD
index 9053ec8..a25ac73 100644
--- a/tests/jvm/java/neverlink/BUILD
+++ b/tests/jvm/java/neverlink/BUILD
@@ -13,11 +13,11 @@
# limitations under the License.
load("//kotlin/jvm/testing:for_analysis.bzl", "kt_for_analysis")
-load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test")
+load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test")
licenses(["notice"])
-jvm_library_test(
+kt_jvm_library_analysis_test(
name = "neverlinked_input_library_test",
expect_neverlink = True,
target_under_test = kt_for_analysis.kt_jvm_library(