Java runfiles library: move tests to subdirectory
RELNOTES: none
PiperOrigin-RevId: 224979623
diff --git a/tools/java/runfiles/BUILD b/tools/java/runfiles/BUILD
index b69fe34..9388841 100644
--- a/tools/java/runfiles/BUILD
+++ b/tools/java/runfiles/BUILD
@@ -4,8 +4,11 @@
name = "srcs",
srcs = glob(
["**"],
- exclude = [".*"], # .swp files and such
- ),
+ exclude = [
+ ".*",
+ "*~",
+ ], # .swp files and such
+ ) + ["//tools/java/runfiles/testing:srcs"],
visibility = ["//tools/java:__pkg__"],
)
@@ -29,41 +32,7 @@
java_library(
name = "runfiles",
srcs = [":java-srcs"],
-)
-
-java_test(
- name = "RunfilesTest",
- srcs = ["RunfilesTest.java"],
- test_class = "com.google.devtools.build.runfiles.RunfilesTest",
- deps = [":test_deps"],
-)
-
-java_test(
- name = "UtilTest",
- srcs = ["UtilTest.java"],
- test_class = "com.google.devtools.build.runfiles.UtilTest",
- deps = [":test_deps"],
-)
-
-java_library(
- name = "test_deps",
- testonly = 1,
- exports = [
- ":mock-file",
- ":runfiles",
- "//third_party:guava",
- "//third_party:guava-testlib",
- "//third_party:junit4",
- "//third_party:truth",
- ],
-)
-
-java_library(
- name = "mock-file",
- testonly = 1,
- srcs = ["MockFile.java"],
- exports = ["//third_party:guava"],
- deps = ["//third_party:guava"],
+ visibility = ["//tools/java/runfiles/testing:__pkg__"],
)
test_suite(
@@ -78,6 +47,7 @@
name = "all_windows_tests",
tests = [
":windows_tests",
+ "//tools/java/runfiles/testing:all_windows_tests",
],
visibility = ["//tools/java:__pkg__"],
)
diff --git a/tools/java/runfiles/testing/BUILD b/tools/java/runfiles/testing/BUILD
new file mode 100644
index 0000000..007c583
--- /dev/null
+++ b/tools/java/runfiles/testing/BUILD
@@ -0,0 +1,64 @@
+package(default_visibility = ["//visibility:private"])
+
+filegroup(
+ name = "srcs",
+ srcs = glob(
+ ["**"],
+ exclude = [
+ ".*",
+ "*~",
+ ], # .swp files and such
+ ),
+ visibility = ["//tools/java/runfiles:__pkg__"],
+)
+
+java_test(
+ name = "RunfilesTest",
+ srcs = ["RunfilesTest.java"],
+ test_class = "com.google.devtools.build.runfiles.RunfilesTest",
+ deps = [":test_deps"],
+)
+
+java_test(
+ name = "UtilTest",
+ srcs = ["UtilTest.java"],
+ test_class = "com.google.devtools.build.runfiles.UtilTest",
+ deps = [":test_deps"],
+)
+
+java_library(
+ name = "test_deps",
+ testonly = 1,
+ exports = [
+ ":mock-file",
+ "//third_party:guava",
+ "//third_party:guava-testlib",
+ "//third_party:junit4",
+ "//third_party:truth",
+ "//tools/java/runfiles",
+ ],
+)
+
+java_library(
+ name = "mock-file",
+ testonly = 1,
+ srcs = ["MockFile.java"],
+ exports = ["//third_party:guava"],
+ deps = ["//third_party:guava"],
+)
+
+test_suite(
+ name = "windows_tests",
+ tags = [
+ "-no_windows",
+ "-slow",
+ ],
+)
+
+test_suite(
+ name = "all_windows_tests",
+ tests = [
+ ":windows_tests",
+ ],
+ visibility = ["//tools/java/runfiles:__pkg__"],
+)
diff --git a/tools/java/runfiles/MockFile.java b/tools/java/runfiles/testing/MockFile.java
similarity index 100%
rename from tools/java/runfiles/MockFile.java
rename to tools/java/runfiles/testing/MockFile.java
diff --git a/tools/java/runfiles/RunfilesTest.java b/tools/java/runfiles/testing/RunfilesTest.java
similarity index 100%
rename from tools/java/runfiles/RunfilesTest.java
rename to tools/java/runfiles/testing/RunfilesTest.java
diff --git a/tools/java/runfiles/UtilTest.java b/tools/java/runfiles/testing/UtilTest.java
similarity index 100%
rename from tools/java/runfiles/UtilTest.java
rename to tools/java/runfiles/testing/UtilTest.java