Skip to content

Commit

Permalink
Move bazel apple tests into a separate package.
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=135686367
  • Loading branch information
Dmitry Shevchenko authored and hermione521 committed Oct 11, 2016
1 parent f44211c commit 3e5ac9d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 58 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ filegroup(
name = "workspace-file",
srcs = [":WORKSPACE"],
visibility = [
"//src/test/shell/bazel:__pkg__",
"//src/test/shell/bazel:__subpackages__",
"//tools/cpp/test:__pkg__",
],
)
Expand Down
57 changes: 3 additions & 54 deletions src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//src/test/shell/bazel/android:srcs",
"//src/test/shell/bazel/apple:srcs",
"//src/test/shell/bazel/testdata:srcs",
],
visibility = ["//src/test/shell:__pkg__"],
Expand All @@ -17,35 +18,6 @@ genrule(
cmd = "cp $< $@",
)

config_setting(
name = "darwin",
values = {"host_cpu": "darwin"},
)

filegroup(
name = "objc-deps",
testonly = 1,
srcs = select({
":darwin": [
"//src/objc_tools/bundlemerge:bundlemerge_deploy.jar",
"//src/objc_tools/plmerge:plmerge_deploy.jar",
"//src/objc_tools/xcodegen:xcodegen_deploy.jar",
"//src/tools/xcode/actoolwrapper",
"//src/tools/xcode/environment:environment_plist",
"//src/tools/xcode/ibtoolwrapper",
"//src/tools/xcode/libtool",
"//src/tools/xcode/momcwrapper",
"//src/tools/xcode/realpath",
"//src/tools/xcode/stdredirect:StdRedirect.dylib",
"//src/tools/xcode/swiftstdlibtoolwrapper",
"//src/tools/xcode/xcrunwrapper",
"//tools/osx:xcode-locator",
"//third_party/iossim",
],
"//conditions:default": [],
}),
)

filegroup(
name = "test-deps",
testonly = 1,
Expand Down Expand Up @@ -83,8 +55,8 @@ sh_test(
size = "large",
srcs = ["bazel_example_test.sh"],
data = [
":objc-deps",
":test-deps",
"//src/test/shell/bazel/apple:objc-deps",
],
shard_count = 3,
)
Expand All @@ -98,19 +70,6 @@ sh_test(
],
)

sh_test(
name = "bazel_apple_test",
size = "large",
srcs = ["bazel_apple_test.sh"],
data = [
":objc-deps",
":test-deps",
"//:workspace-file",
"//tools/build_defs/apple/test:srcs",
],
shard_count = 3,
)

sh_test(
name = "bazel_java_test",
size = "large",
Expand Down Expand Up @@ -140,16 +99,6 @@ sh_test(
tags = ["local"],
)

sh_test(
name = "bazel_objc_test",
size = "large",
srcs = ["bazel_objc_test.sh"],
data = [
":objc-deps",
":test-deps",
],
)

sh_test(
name = "bazel_execute_testlog",
srcs = ["bazel_execute_testlog.sh"],
Expand Down Expand Up @@ -390,9 +339,9 @@ sh_test(
size = "large",
srcs = ["bound_targets_test.sh"],
data = [
":objc-deps",
":test-deps",
"//:workspace-file",
"//src/test/shell/bazel/apple:objc-deps",
],
)

Expand Down
62 changes: 62 additions & 0 deletions src/test/shell/bazel/apple/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package(default_visibility = ["//visibility:private"])

filegroup(
name = "srcs",
srcs = glob(["**"]),
visibility = ["//src/test/shell/bazel:__pkg__"],
)

config_setting(
name = "darwin",
values = {"host_cpu": "darwin"},
)

filegroup(
name = "objc-deps",
testonly = 1,
srcs = select({
":darwin": [
"//src/objc_tools/bundlemerge:bundlemerge_deploy.jar",
"//src/objc_tools/plmerge:plmerge_deploy.jar",
"//src/objc_tools/xcodegen:xcodegen_deploy.jar",
"//src/tools/xcode/actoolwrapper",
"//src/tools/xcode/environment:environment_plist",
"//src/tools/xcode/ibtoolwrapper",
"//src/tools/xcode/libtool",
"//src/tools/xcode/momcwrapper",
"//src/tools/xcode/realpath",
"//src/tools/xcode/stdredirect:StdRedirect.dylib",
"//src/tools/xcode/swiftstdlibtoolwrapper",
"//src/tools/xcode/xcrunwrapper",
"//tools/osx:xcode-locator",
"//third_party/iossim",
],
"//conditions:default": [],
}),
visibility = [
"//src/test/shell/bazel:__pkg__",
],
)

sh_test(
name = "bazel_apple_test",
size = "large",
srcs = ["bazel_apple_test.sh"],
data = [
":objc-deps",
"//:workspace-file",
"//src/test/shell/bazel:test-deps",
"//tools/build_defs/apple/test:srcs",
],
shard_count = 3,
)

sh_test(
name = "bazel_objc_test",
size = "large",
srcs = ["bazel_objc_test.sh"],
data = [
":objc-deps",
"//src/test/shell/bazel:test-deps",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

# Load test environment
source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \
source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../test-setup.sh \
|| { echo "test-setup.sh not found!" >&2; exit 1; }

if [ "${PLATFORM}" != "darwin" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# Load test environment
source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \
source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../test-setup.sh \
|| { echo "test-setup.sh not found!" >&2; exit 1; }

if [ "${PLATFORM}" != "darwin" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tools/build_defs/apple/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ filegroup(
name = "srcs",
srcs = glob(["**"]),
visibility = [
"//src/test/shell/bazel:__pkg__",
"//src/test/shell/bazel/apple:__pkg__",
"//tools:__pkg__",
],
)

0 comments on commit 3e5ac9d

Please sign in to comment.